Topic: sticky-top navbar and full page intro don't combine well
nextstepmedia pro asked 6 years ago
Ollie Vincent pro answered 6 years ago
.fixed-top
to fix the navbar over the background image. In the end it should still give the same effect.
Please let me know if you need any help implementing this, or if I understood completely wrong!
Thanks nextstepmedia pro commented 6 years ago
Hey Ollie thx for your response, If I use a fixed-top navbar. The nav will be on top of the image aswell as on top of the content. If I choose this option I will need to add: body { padding-top: 100px;} to get it to work properly. Right? Which forces me to keep the navbar exactly the same height at all times.Ollie Vincent pro commented 6 years ago
Hi nextstepmedia, If you add padding to the body then that will shift the background image down which means you are back to the original problem. I see from your code that the navbar is transparent anyway - and I would try using these two classes: .fixed-top .scrolling-navbar .scrolling-navbar will toggle a second class that you can style individually. ThanksPiotr Glejzer staff answered 6 years ago
.sticky-top{ background: red; } or .sticky-top{ position: fixed; }That's an example of course. Sticky-top is a bootstrap class and it is sticky not fixed. So it generates space between nav and header. Position fixed is fixed, it always on top and all page is under it. Is that resolve your problem? Best, Piotr
Ollie Vincent pro commented 6 years ago
Hi Piotr, I thought you had a fixed-top class for navbars?nextstepmedia pro commented 6 years ago
Yes thats truePiotr Glejzer staff commented 6 years ago
Yes I had it, but I changed it for sticky and I tried to resolve that problem. But use fixed-top is good idea too! Have a nice day!COTIGA answered 6 years ago
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: No
- Technology: MDB jQuery
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No