twitter-bootstrap 更改导航栏高度

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16612314/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 17:09:14  来源:igfitidea点击:

Change navbar height

csstwitter-bootstrap

提问by user2394387

I'm currently using the gae boilerplate for my application. I want to change the size of the navbar component but I don't find the attribute to do it. I have already searched the responses from others subjects but I don't find the attribute to change the height in the css or less bootstrap files.

我目前正在为我的应用程序使用 gae 样板。我想更改导航栏组件的大小,但我没有找到执行此操作的属性。我已经搜索了其他主题的回复,但我没有找到更改 css 或更少引导程序文件中高度的属性。

Is there anyone who has already used the gae boilerplate and can give me an answer ?

有没有人已经使用过gae样板并且可以给我一个答案?

Thank you

谢谢

采纳答案by JAM

For twitter bootstrap, set the heightor min-heightproperty of the .navbar-innerclass.

对于 twitter bootstrap,设置类的heightormin-height属性.navbar-inner

For example:

例如:

.navbar-inner {
    height: 80px;  
}

FIDDLE

小提琴

回答by Kelley Kavanaugh

I found that I needed to change the padding on the navbar class and the nav class for lists:

我发现我需要更改导航栏类和列表的导航类上的填充:

.navbar .brand,
.navbar .nav > li > a {
    padding: 0 30px 0 30px;
}

回答by JayCrossler

The accepted answer only worked partially for me on Bootstrap 2.12. This worked better for me (where .widget is the class of the items I want to have smaller navbars on):

接受的答案仅在 Bootstrap 2.12 上对我有用。这对我来说效果更好(其中 .widget 是我想要使用较小导航栏的项目的类别):

.navbar .brand,
.navbar .nav > li > a {
    padding: 8px 10px 0px 10px;
}
.navbar-inner{
    min-height:16px;
}
.navbar .navbar-inner .brand {
    margin-top: 0px;
}
.widget .navbar .navbar-inner .nav .dropdown a {
    margin-top: 0px;
}
.widget .navbar .navbar-inner a.btn {
    margin-top: 2px;
}