twitter-bootstrap Bootstrap 导航栏边距
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16118747/
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
Bootstrap navbar margins
提问by user1377822
I'd like to make the left and right margins of the navbar conetnt smaller so the "brand" (left most component) appears more on the left then the default and same for the right component.
我想让导航栏 conetnt 的左右边距更小,以便“品牌”(最左边的组件)在左侧出现更多,然后是右侧组件的默认值和相同。
Can somebody point me to relevant less variables to modify?
有人可以指出我要修改的相关较少变量吗?
Thanks
谢谢
回答by David Taiaroa
With a basic layout, the CSS selector you want is
有了基本的布局,你想要的 CSS 选择器就是
body > .navbar .brand
Play with margin-left and margin-right until you get the result you want. Depending on how you are calling your CSS styles, you may need to add !important as well, eg
使用 margin-left 和 margin-right 进行操作,直到得到你想要的结果。根据您调用 CSS 样式的方式,您可能还需要添加 !important,例如
body > .navbar .brand{
margin-left:-20px !important;
margin-right:-20px !important;
}
If you don't have any success with this, try ommitting body >
如果您对此没有任何成功,请尝试省略body >
EDIT
编辑
If you want to change the width of the entire navbar, try something like
如果要更改整个导航栏的宽度,请尝试类似
.navbar{
margin-left:-20px;
margin-right:-20px;
}
You might also need to adjust the details for navbar-inner, eg
您可能还需要调整导航栏内部的详细信息,例如
.navbar-inner{
padding-left:0;
padding-right:0;
}
Edit
See if this helps: http://jsfiddle.net/panchroma/zBeZF/
编辑
看看这是否有帮助:http: //jsfiddle.net/panchroma/zBeZF/
Good luck!
祝你好运!

