Make transparent header solid colour on scroll

Hi,

I’m looking to make the transparent header a solid colour on scroll.

Website is here: http://hayselden-leisure.flywheelsites.com/

How would I go about doing that please?

Many thanks,

Joe

Hi Joe,

To achieve that, please the my-bar class to your bar:

After that add this custom CSS:

.my-bar.x-bar-fixed {
     background: #fff !important;
}

If you would like to learn CSS, I am sharing few resources that you take a look to get started with CSS and an interesting tool that you can use to speed up the development process.

I recommend you to watch following video that will help you to get started with CSS.

https://www.youtube.com/watch?v=MFR4WXiLzpc

Sometimes it can get a bit difficult to find out the right selector to be able to write the required CSS codes. A handy tool that can help you in this is Google Chrome dev tools. I am sharing the resource that you can refer to get started with dev tools.

https://developers.google.com/web/tools/chrome-devtools/css/

https://developers.google.com/web/tools/chrome-devtools/

https://www.youtube.com/watch?v=tP_kXBJWPhQ&t=200s

Thanks.

That’s worked perfectly.

You’re welcome!
Thanks for letting us know that it has worked for you.

I also added a bit of a transition if anyone else is reading this thread:

.my-bar.x-bar-fixed {
background: #fff !important;
transition: 500ms;
}

Thanks for sharing the solution with our community members. :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.