I have a home page with a container at the top that functions as a page hero. I would like the page hero to be sticky, so that the rest of the page content scrolls over it. Following advice found here, I assigned the hero container block to the fixed-hero class and added the following CSS:
.fixed-hero{
position: sticky;
/* for Safari: */
position: -webkit-sticky;
top: 0;
}
This worked, except it made the hero hide some (not all) of the containers on the page, including the page headline. If I added z-index=-1, everything shows as it should, except that the hero is overlain by a whitish color.
What’s going on? I’ve attached links to two versions of the home page. The only difference between them is that in the second, I’ve assigned the hero to the fixed-hero class.
Thanks for any help.
Dan