MIkCode
MIkCode

Reputation: 2845

Bootstrap navbar navbar-fixed-top crash down after certain size

I'm trying to implement a fixed nav bar, but after certain screen size (~width:989), the nav bar moves down. It doesn't work on mobile either.

Image: Navbar

The navbar is completely stuck to the footer instead of staying on top of the page.

You can check the code at: http://www.lostsavings.co.il

Upvotes: 1

Views: 568

Answers (1)

Ryan
Ryan

Reputation: 6249

You have a few other issues, but the major issue is that the nav-fixed-top content is at the bottom of the page right now... in other words, you have:

<div class="container"> content here </div>
<div class="navbar"></div>
<div class="footer"></div>

Move that navbar to the top of the natural document flow, as if you were using no bootstrap, jquery, etc...

<div class="navbar"></div>
<div class="container"> content here </div>
<div class="footer"></div>

You'll have to fine-tune quite a few margins, etc... and I see a few !importants that could be getting in the way, too, but I'm guessing some of that has been part of your attempt to troubleshoot this. Making the above change at least made the navbar appear at the top for me.

Upvotes: 1

Related Questions