Bootstrap navbar margins

被刻印的时光 ゝ 提交于 2020-06-27 08:20:15

问题


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?

Thanks


回答1:


With a basic layout, the CSS selector you want is

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

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

If you don't have any success with this, try ommitting 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/

Good luck!



来源:https://stackoverflow.com/questions/16118747/bootstrap-navbar-margins

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!