css - Twitter-Bootstrap 导航栏高度太小

标签 css twitter-bootstrap navbar

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/

相关文章:

css - 使用 CSS :not selector in LESS nested rules

javascript - 如何使用 AngularJS 从自定义 URL 获取字体?

html - Bootstrap/CSS 中的水平滚动表

html - 导航栏的 Bootstrap 下拉菜单

javascript - 导航栏取决于宽度

css - 使用CSS选择dom元素选择包含大于X的数字的类名

jquery - 如何操作用户滚动?

javascript - 翻译后将 html 元素返回到其原始位置

javascript - Bootstrap 中的中间中心 div

iphone - 在 Storyboard 中隐藏一个 ViewController 的 NavigationBar