Notice: These forums are now retired and closed. For active support, please Submit a Ticket or visit our official WordPress.org community pages.
Kadence Theme | Kadence Blocks | Starter Templates | WooCommerce Email Designer | Ascend | Virtue | Pinnacle

drop shadow on sticky header

Home / Forums / Kadence Theme / drop shadow on sticky header

This topic is: Resolved
[Resolved]
Posted in: Kadence Theme
January 13, 2024 at 7:16 pm

Hi,

I would like to add a drop shadow to my sticky header. I’d like the drop shadow to not be visible when the page loads but to be visible on scroll. I have searched through the forum and have found two pieces of CSS code. The first works perfectly on desktop but doesn’t seem to do anything on mobile.

#main-header .item-is-fixed {
box-shadow: 0 2px 4px rgb(45 62 80 / 12%);
}

The second code works perfectly on desktop and mobile with the exception that the shadow is visible on page load.

#masthead, #masthead .item-is-stuck {
-webkit-box-shadow: 0 2px 4px rgb(45 62 80 / 12%);
-moz-box-shadow: 0 2px 4px rgb(45 62 80 / 12%);
box-shadow: 0 2px 4px rgb(45 62 80 / 12%);
}

I’d appreciate if you could provide me the CSS that works on all devices and only has the drop shadow when the user has started to scroll down the page as in the first example.

Thanks,
Gary

  • The forum ‘Kadence Theme’ is closed to new topics and replies.