css - 如何降低 Bootstrap 3 中的导航栏高度?

标签 css twitter-bootstrap

我想让 BS3 中的导航栏高度为 20px。我该怎么做?

我试过以下方法:

.tnav .navbar .container { height: 28px; }

什么也没做。

.navbar-fixed-top {
    height: 25px; /* Whatever you want. */
}

似乎可以增加栏的大小,但不能减少。

在保持容器对齐等的同时执行此操作的好方法是什么

最佳答案

bootstrap 在 .navbar-nav > li > a 上有 15px top padding 和 15px bottom padding,所以你需要通过在你的 css 文件和 .navbar 中覆盖它来减少它> 有 min-height:50px; 尽可能减少它。

例如

.navbar-nav > li > a {padding-top:5px !important; padding-bottom:5px !important;}
.navbar {min-height:32px !important}

将这些类添加到您的 css,然后检查。

关于css - 如何降低 Bootstrap 3 中的导航栏高度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19576175/

相关文章:

javascript - 谷歌图表背景

javascript - Twitter Bootstrap 选项卡未激活

javascript - Bootstrap 不关闭菜单

javascript - 如何使用 jquery 将数据属性附加到类

html - 在大屏幕上对齐同一行/行/div 上的图像

html - mat-pagination 中的 mat-select 行为异常

javascript - 无法避免一个 div 踩到另一个 div

javascript - 无法将 React Native View 放在底部

css - 字体在 2 台服务器上的 Chrome 中呈现不同

html - 尝试使用 Zurb Foundation 使电子邮件在响应列点折叠