The default height of navbar in Twitter-Bootstrap is too small. When height is increased, it encroaches the divs below. How can I increase the height of the navbar that slides the entire page down? If this is possible, how to place navbar links to top / bottom of the navbar.
-
solved. changed height in .navbar .nav added padding-top and gave a value – Gattoo Mar 30 '12 at 09:15
-
post your results as an answer and approve it by ticking the green checkmark to give this question closure, this way it will help other users in the future. – Andres I Perez Apr 02 '12 at 11:55
-
Thanks you. I would love someone else, may be you, do it. – Gattoo Apr 03 '12 at 05:01
-
Related answer: http://stackoverflow.com/a/11008050/977939 – jpillora Oct 04 '12 at 17:21
4 Answers
I'm pretty sure I don't love this solution but it works for the amount of time I have to spend on this.
.navbar .container { height: 2em; }
I had to also add some padding-top in the same selector to get things inside the navbar to vertically align nicely.
edit: I just re-read your question and saw you're having trouble with the "divs below". In doing this you need to adjust padding on the body tag as well, e.g.
body { padding-top: 6em; }
per the Twitter Bootstrap docs on Navbar:
When you affix the navbar, remember to account for the hidden area underneath. Add 40px or more of apdding to the <body>. Be sure to add this after the core Bootstrap CSS and before the optional responsive CSS.

- 1,419
- 14
- 17
Adding a padding like that is not enough if you're using responsive bootstrap. In this case when you resize your window you'll get a gap between top of the page and navbar. A proper solution looks like this:
body {
padding-top: 60px;
}
@media (max-width: 979px) {
body {
padding-top: 0px;
}
}
Source: Twitter Bootstrap - top nav bar blocking top content of the page
you can try this one. it works in any size of display.
.navbar .container { min-height: 83px; }
.navbar-fixed-top {
position:static;
margin-bottom:20px;
}

- 309
- 1
- 6
</script>
$(".dropdown-toggle").click(function () {
$(".nav-collapse").css('height', 'auto')
});
</script>
This solved a similar problem of mine, (The sub menus was not appearing because of the small parent ul height, on the first click) maybe it works for you as well.

- 1
- 1