如何减少Bootstrap 3中的导航栏高度? [英] How do you decrease navbar height in Bootstrap 3?

查看:140
本文介绍了如何减少Bootstrap 3中的导航栏高度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想让我的导航栏在BS3的高度20px。

I want to make my navbar in BS3 to be of height 20px. How do I do this?

我尝试过以下操作:

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

没有任何动作。

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

看来能够增加栏的大小,减少。

Appears to be able to increase the size of the bar, but cannot decrease.

这是一个很好的方法来保存容器的对齐方式。

What is a good way to do this while preserving the container's alignment, etc.

推荐答案

bootstrap在 .navbar-nav>上有15px顶部填充和15px底部填充。 li>一个所以你需要减少它通过覆盖你的css文件和 .navbar min-height:50px;

bootstrap had 15px top padding and 15px bottom padding on .navbar-nav > li > a so you need to decrease it by overriding it in your css file and .navbar has min-height:50px; decrease it as much you want.

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

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

add these classes to your css and then check.

这篇关于如何减少Bootstrap 3中的导航栏高度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆