Site logo

Archived topic

Sticky Header

5 replies · Started by Suman on March 29, 2023

Viewing posts 1–6 of 6

How can I add a shadow to my sticky header while it's scrolling?

The shadow will help distinguish it from the white space.

I have used the following CSS code:
header.site-header {
position: sticky;
top: 0;
z-index: 10001;
}

I got this from another thread.

Sorry I forgot to mention my website.

Is it possible to add a shadow using CSS?

You can add the following line to your existing CSS:
box-shadow: 10px 10px 5px 0px rgba(0,0,0,0.75);

However, this will add shadow to both static and sticky modes.

This archived topic is closed to new replies.