Twitter Bootstrap:如何使顶部固定导航栏留在容器中而不是拉伸? [英] Twitter Bootstrap: How to make top fixed navbar stay in container and not stretch?
问题描述
我正在使用 Twitter Bootstrap 和您在指南中看到的常规导航栏:http://twitter.github.io/bootstrap/components.html#navbar
我不希望导航一直向左或向右伸展,而是像指南中那样停留在我可以看到两侧的位置.唯一的区别是它会固定在顶部.
我想知道,如何使它成为一个固定的导航栏,就像我在使用 navbar-fixed-top
类一样?
你应该能够做到:
I'm working with Twitter Bootstrap and the regular navbar you see in the guides: http://twitter.github.io/bootstrap/components.html#navbar
I don't want the navigation to stretch all the way left or right but stay where I can see both sides just like in the guide. The only difference is it would be fixed to the top.
I was wondering, how do I make this become a fixed navbar as if I was using the navbar-fixed-top
class?
You should be able to do:
<div class="navbar-fixed-top container">
<div class="navbar">
<div class="navbar-inner">
<a class="brand" href="#">Title</a>
<ul class="nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
</ul>
</div>
</div>
</div>
这篇关于Twitter Bootstrap:如何使顶部固定导航栏留在容器中而不是拉伸?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!