引导导航栏边距 [英] Bootstrap navbar margins

查看:100
本文介绍了引导导航栏边距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使导航栏竞争的左右边距变小,以便品牌"(最左侧的组件)在左侧比默认显示更多,而在右侧组件则相同.

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.

有人可以指出我要修改的较少相关变量吗?

Can somebody point me to relevant less variables to modify?

谢谢

推荐答案

使用基本布局,您想要的CSS选择器是

With a basic layout, the CSS selector you want is

body > .navbar .brand

在左边距和右边距处进行播放,直到获得所需的结果为止.根据您如何调用CSS样式,您可能还需要添加!important,例如

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

body > .navbar .brand{
margin-left:-20px !important;
margin-right:-20px !important;  
}

如果您没有成功,请尝试省略 body>

If you don't have any success with this, try ommitting body >

编辑

如果要更改整个导航栏的宽度,请尝试类似

If you want to change the width of the entire navbar, try something like

.navbar{
margin-left:-20px;
margin-right:-20px;
}

您可能还需要调整navbar-inner的详细信息,例如

You might also need to adjust the details for navbar-inner, eg

.navbar-inner{
padding-left:0;
padding-right:0;
}  

修改
看看是否有帮助: http://jsfiddle.net/panchroma/zBeZF/

祝你好运!

这篇关于引导导航栏边距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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