我有这个Twitter Bootstrap代码 div class='navbar navbar-fixed-top' div class='navbar-inner' div class='container' a class='btn btn-navbar' data-target='.nav-collapse' data-toggle='collapse' span class='icon-bar'/span span class='icon-b
<div class='navbar navbar-fixed-top'> <div class='navbar-inner'> <div class='container'> <a class='btn btn-navbar' data-target='.nav-collapse' data-toggle='collapse'> <span class='icon-bar'></span> <span class='icon-bar'></span> <span class='icon-bar'></span> </a> <div class='nav-collapse'> <ul class='nav'> <li class='active'> <a href='some_url'>My Home</a> </li> <li> <a href='some_url'>Option 1 </a> </li> <li> <a href='some_url'>Another option</a> </li> <li> <a href='some_url'>Another option</a> </li> </ul> </div> </div> </div> </div>
但是当我查看页面的开头时,导航栏会阻止页面顶部附近的一些内容.如果在查看页面顶部时如何降低其余内容,以便内容不会被导航栏阻止,是否有任何想法?
添加到您的CSS:body { padding-top: 65px; }
从Bootstrap docs:
The fixed navbar will overlay your other content, unless you add padding to the top of the body.