Art.S Posted February 2, 2017 Share Posted February 2, 2017 Hi,Could someone please help, I would like to fix my website's header when scrolling.However, when I do the following: .header-default #header-main { background: white; z-index: 1; position: fixed; padding: 20px 0; width: 100%; } The Result is having a fixed header.However, all the content goes up and moves behind the header. This essentially hides my MainNav and cuts into a bit of the Image slider. I have attached some screen shots Below. Any help would be highly appreciated. 01 - How it is Normally.02 - What happens after applying the code for fixed headerWebsite URL: www.atlas.com.bd Link to comment Share on other sites More sharing options...
JeredBolton Posted February 2, 2017 Share Posted February 2, 2017 To make this work as described you need to change the css for a number of elements: .header-default .topbar { background-color: #fbfbfb; border-bottom: 1px solid #dce0e2; color: #92989a; position: fixed; top: 0; width: 100%; z-index: 150; } .header-default #header-main { background: white none repeat scroll 0 0; padding: 20px 0; position: fixed; top: 47px; width: 100%; z-index: 150; } #pts-mainnav { color: #999999; margin-top: 187px; } You need a high z-index for these elements to ensure they stay on top of other page content. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now