Css 如何使图像库与twitter引导一起工作?
我正在尝试使用索引页上的图像库。但这真的很难做到。这是我的代码:Css 如何使图像库与twitter引导一起工作?,css,image,twitter-bootstrap,Css,Image,Twitter Bootstrap,我正在尝试使用索引页上的图像库。但这真的很难做到。这是我的代码: .container .row .col-md-8.col-sm-8.col-xs-8 - 4.times do |i| .col-md-1.col-sm-1.col-xs-1 %img.img-responsive.img-rounded{:alt => "", :src => "http://placehold.it/300"} .col-md-4
.container
.row
.col-md-8.col-sm-8.col-xs-8
- 4.times do |i|
.col-md-1.col-sm-1.col-xs-1
%img.img-responsive.img-rounded{:alt => "", :src => "http://placehold.it/300"}
.col-md-4 //consider simple code in for this column !
在添加容器、行和其他内容之前,我尝试过,但图像总是变小。我的代码是smth错了吗?我是否在引导行为方面犯了一些错误?我是新手,希望这是一个可能对您有所帮助的答案: 我不知道你为什么要这样填 容器(在引导计数中)的宽度为12。因此,您可以将12个元素放入
col-**-1
类或4个col-**-3
类中。如果你不把它填满,它就不会显得更大,尽管会有足够的空间
这里有一个简单html解决方案,列大小为3,因此4个图像以合适的大小显示:
<div class="container">
<div class="row">
<div class="col-md-12 col-sm-8 col-xs-8">
<div class="col-md-3 col-sm-3 col-xs-3">
<img class="img-responsive img-rounded" src="http://placehold.it/300" />
</div>
<div class="col-md-3 col-sm-3 col-xs-3">
<img class="img-responsive img-rounded" src="http://placehold.it/300" />
</div>
<div class="col-md-3 col-sm-3 col-xs-3">
<img class="img-responsive img-rounded" src="http://placehold.it/300" />
</div>
<div class="col-md-3 col-sm-3 col-xs-3">
<img class="img-responsive img-rounded" src="http://placehold.it/300" />
</div>
</div>
</div>
</div>
顺便问一下:这是一种很酷的标记语言吗?请问,这个问题有什么问题吗?它是haml。我不是html前端专家,也不想花时间编写html/样式代码。所以我试着用haml来提高我的生产力