3

I am using the latest version of Bootstrap (2.02) and I want to center all of the links in the navbar and still have a responsive layout. I cannot find a solution to having a centered and fixed layout let alone a responsive as well.

Can anyone point me in the right direction?

4

2 回答 2

4

如果您不关心 IE<8,您可以添加以下 CSS

.navbar .nav{
    float: none;
    text-align: center;
}
.navbar .nav > li{
    float: none;
    display: inline-block;
}
于 2013-01-25T20:02:17.123 回答
0

以下应该适用于中心对齐:

.navbar .nav > li > a {
  padding: 15px 20px; 
  text-align: center;
  float: none;
  display: inline-block;
}

似乎 IE 8 及以下版本不支持媒体查询

于 2013-01-29T22:18:41.130 回答