layout between top fixed bar and the main container
I am using the same main layout as bootstrap site http://twitter.github.com/bootstrap/:
<body>
<div class="navbar navbar-fixed-top">....</div>
<div class="container">...</div>
</body>
In bootstrap site, I can see the main div container layout has some space with the topbar, which is very nice. but in my case, my main container is hiding behind the topbar, In other words, the topbar overlay the main container. I can fix it with css:
.container{
padding-top:60px;
}
but this solution has a problem when we view the page in mobile screena. does anybody know why this is happening. thanks for help.
This is mentioned in the docs—you have to add padding or margin to something to offset the overlaying navbar. Add the responsive CSS file in your head or create your own media query to reset the padding for mobile resolutions.
I've got the same problem, and I didn't see it in the docs (though I will look again now). My suggestion would be to link to the docs when you refer to them otherwise it's not so much a helpful answer as a deflected question.
http://twitter.github.com/bootstrap/components.html#navbar underneath "Optional display variations"
Fix the navbar to the top or bottom of the viewport with an additional class on the outermost div, .navbar.
Fixed to top Add .navbar-fixed-top and remember to account for the hidden area underneath it by adding at least 40px padding to the
. Be sure to add this after the core Bootstrap CSS and before the optional responsive CSS.