Twitter-Bootstrap 中导航栏的默认高度太小。当高度增加时,它会侵占下面的 div。 如何增加向下滑动整个页面的导航栏的高度?如果可能,如何将导航栏链接放置到导航栏的顶部/底部。
最佳答案
我很确定我不喜欢这个解决方案,但它对我必须花在这上面的时间有效。
.navbar .container { height: 2em; }
我还必须在同一个选择器中添加一些 padding-top 以使导航栏内的内容能够很好地垂直对齐。
编辑:我刚刚重新阅读了您的问题,发现您在使用“下方的 div”时遇到了问题。为此,您还需要调整 body 标签上的填充,例如
body { padding-top: 6em; }
根据 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.
关于css - Twitter-Bootstrap 导航栏高度太小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9923739/