Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Adding an overlay to the showcase image

Started by Lewis 9 years ago · 1 replies · 1393 views
9 years ago

Hi! I'm trying to add an overlay to the showcase image(theme: Woo) however my attempts are futile.

Basically, i'd like to display the hero-text and button in the centre of the image, rather than above(or beneath), while also adding a mostly transparent box behind it so that it stays readable.

My website is: mark-nichols.net

Thanks!

9 years ago

hi !

It' just CSS tweak, take a look Here Woo Repo

replace img/hero-bg.png with your hero img url add height style for instance height: 600px;
do the same with img/[email protected] but adjust height and maybe alternate version of your hero image

CSS
/* ------------------------------------------------------------------ */
/* c. Hero Section
/* ------------------------------------------------------------------ */

#hero {
   padding-top: 66px;
   background: #23292f url(img/hero-bg.png);
   overflow: hidden;
}

/* For high-res devices */
@media
(-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

    #hero { 
        background: #23292f url(img/[email protected]); 
        background-size: 200px 200px;
    }

}

See in action !
33|690x275

of course you don't need the showcase_image (the one with phone, tablet and laptop), but adjust your height according to your needs.

To add an overlay

CSS
#hero .twelve {
    background-color: rgba(0, 0, 0, 0.8);
}

In a second time you can change the blueprint from showcase modular : for instance add a color field for overlay, and a media field to change the hero background etc Everything is possible with Grav.

The best way is to use theme inheritance to do your changes without modify original theme

Hope that helps

Dimitri

last edited 02/27/18 by Dimitri Longo

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by themetman, 6 days ago
1 104 3 days ago
Themes & Styling · by AH, 3 weeks ago
1 224 3 days ago
Themes & Styling · by Bruno, 4 years ago
6 1388 3 days ago
Themes & Styling · by TomW, 3 weeks ago
2 227 5 days ago
Themes & Styling · by FrViPofm, 2 months ago
4 687 2 months ago