我有一个由4列组成的图像网格,我想将其更改为两列行。我以为这会成功:col-lg-3 col-xs-2
,但它没有。
我哪里出问题了?
代码:
.test-content{
width:100%;
height:100px;
background:lightblue;
}
<div class="row">
<div class="col-lg-3 col-xs-2">
<div class="test-content">content</div>
</div>
<div class="col-lg-3 col-xs-2">
<div class="test-content">content</div>
</div>
<!-- It's like I should have a closing div here for the first row, and open another row just for col-xs-2, but obviously I can't do this for col-lg-3 -->
<div class="col-lg-3 col-xs-2">
<div class="test-content">content</div>
</div>
<div class="col-lg-3 col-xs-2">
<div class="test-content">content</div>
</div>
</div>
发布于 2015-04-19 08:17:15
引导程序正在使用一个划分为12个部分的网格。
col-lg-3表示它的宽度为3/12,所以如果你想要2行,你需要col 6。
xs也是如此:
col-xs-3表示它的宽度为3/12,所以如果你想要xs屏幕上的2行,你需要-xs-6。
发布于 2015-04-19 08:15:13
自举网格系统有12个网格。因此,与col-xs-2
不同,您应该编写col-xs-6
,以便在一行中有2个图像。
https://stackoverflow.com/questions/29732272
复制