Twitter Bootstrap - navbar中的品牌标志 [英] Twitter Bootstrap - centering brand logo in navbar

查看:95
本文介绍了Twitter Bootstrap - navbar中的品牌标志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试将 .brand 标志与:

 品牌{margin-left:auto; margin-right:auto; } 

这是我的顶部navbar布局:



http://jsfiddle.net/J4zkJ/3/



但它似乎不起作用。



我在堆栈上搜索发布此答案和上面使用的代码,是从一个回答的问题。 / p>

任何想法如何使.brand中心?



注意:我不能使用位置:绝对和固定,我想这样做响应( responsive



<我也尝试这样:

  .brand {
margin:0 auto!important;
padding:0 auto!important;
position:absolute!important;
right:0px;
left:0px;
z-index:9999999999!important;

}


解决方案

  .navbar .brand {
margin-left:auto;
margin-right:auto;
width:60px;
float:none;
}



我给它一个任意宽度,设置为任何你想要的。



jsFiddle


I tryed centering the .brand logo with:

.brand { margin-left: auto; margin-right: auto; }

this is my top navbar layout:

http://jsfiddle.net/J4zkJ/3/

but it seems it doesn't works.

I searched on stack before to post this answer and the code i used above, is taken from an answered question.

Any idea how to center .brand ?

NB: i can't use position:absolute and fixed, and i would like to do this responsively (responsive)

also i tryed this:

.brand { 
  margin:0 auto !important;
  padding:0 auto !important;
  position:absolute !important;
  right:0px;
  left:0px;
   z-index:9999999999 !important;

}

解决方案

.navbar .brand {
  margin-left: auto;
  margin-right: auto;
  width: 60px;
  float: none;
}

I gave it an arbitrary width, set it to whatever you'd like.

jsFiddle

这篇关于Twitter Bootstrap - navbar中的品牌标志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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