我有这个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-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; }
The fixed navbar will overlay your other content,unless you add padding to the top of the body.