2014-02-26 55 views
-1

我是新手,使用Bootstrap 3。我做了一个容器12列与width: 960px;。然后我注意到容器大小改为width: 1110px。谁能告诉我问题是什么?我只想要一个宽度为960px的固定容器;bootstrap 3容器大小

请检查here

我找到的CSS:

.col-lg-12 { 
    margin-left: 0; 
    min-height: 1px; 
    padding-left: 15px; 
    padding-right: 15px; 
    position: relative; 
} 
+0

[Bootstrap:如何更改容器的宽度?](http://stackoverflow.com/questions/15884102/bootstrap-how-do-i-change-the-宽度的容器) –

+0

阅读关于它[这里](http://getbootstrap.com/getting-started/#disable-responsive)。看看这个例子[这里](http://getbootstrap.com/examples/non-responsive/)。得到你所有的CSS [这里](http://getbootstrap.com/examples/non-responsive/non-responsive.css) – slynagh

+0

@Mohamed Samy你是否在这些** Sass **或** LESS **? – Muhammed

回答

0

从bootstrap.css

.container { 
    margin-right: auto; 
    margin-left: auto; 
    padding-left: 6px; 
    padding-right: 6px; } 
    .container:before, .container:after { 
    content: " "; 
    display: table; } 
    .container:after { 
    clear: both; } 
    @media (min-width: 768px) { 
    .container { 
     width: 732px; } } 
    @media (min-width: 992px) { 
    .container { 
     width: 952px; } } 
    @media (min-width: 1200px) { 
    .container { 
     width: 1152px; } } 

修改这个CSS属性中删除

@media (min-width: 1200px) { 
    .container { 
     width: 1152px; } 

更新

@media (min-width: 990px) { 
    .container { 
     width: 950px; } } 

请在下面评论,如果任何错误,而使用这个代码

+0

以上代码在引导程序中不存在3.1 – HenryW

+0

@HenryW哪个代码? – Muhammed

+0

'.container {margin} - right:auto; margin-left:auto; padding-left:6px; padding-right:6px; } 。容器:之前,.container:之后{ 内容:“”; display:table; } 。容器:在{ 明确:两者; } @media(min-width:768px){ .container { width:732px; }} @media(min-width:992px){ .container { width:952px; }} @media(min-width:1200px){ 。容器{宽度:1152px; }}' – HenryW

0

值得注意的是:如果你正在使用青菜与引导,改变容器的大小就像改变一个变量一样简单。在引导3(3.3.5确切地说)在variables.less文件看起来像这样的容器设置:

//== Container sizes 
// 
//## Define the maximum width of `.container` for different screen sizes. 

// Small screen/tablet 
@container-tablet:    (720px + @grid-gutter-width); 
//** For `@screen-sm-min` and up. 
@container-sm:     @container-tablet; 

// Medium screen/desktop 
@container-desktop:   (940px + @grid-gutter-width); 
//** For `@screen-md-min` and up. 
@container-md:     @container-desktop; 

// Large screen/wide desktop 
@container-large-desktop:  (1140px + @grid-gutter-width); 
//** For `@screen-lg-min` and up. 
@container-lg:     @container-large-desktop; 

(见bootstrap's github repo

所以适应的.container大小为大屏幕,简单地覆盖通过将其添加到您自己的variables.less -file变量@container-large-desktop

@container-large-desktop: ((930px + @grid-gutter-width)); 

@grid-gutter-witdh设置为30px在默认情况下,因此以上会导致有一个960像素的容器)