我有3行图像。
图像左侧有白色空间。
右侧图像右侧有空白区域。使用引导区时左右图像的左右空格
我该如何解决这个问题,所以我没有任何左右侧的空间?
见下面我的代码:
背景是橙色的图像所以最好可见。
HTML:
<div class="container section">
<div class="row">
<div class="col-md-offset-1 col-md-10 featured">
<div class="col-md-4 img-featured-1">
<%= image_tag("featured-1.jpeg", class: "img-responsive") %>
</div>
<div class="col-md-4 img-featured-2">
<%= image_tag("featured-2.jpeg", class: "img-responsive") %>
</div>
<div class="col-md-4 img-featured-3">
<%= image_tag("featured-3.jpeg", class: "img-responsive") %>
</div>
</div>
</div>
</div>
CSS:
.featured {
background-color: orange;
}
.img-featured-1 {
width: 33.33333%;
float: left;
}
.img-featured-2 {
width: 33.33333%;
}
.img-featured-3 {
width: 33.33333%;
float: right;
}
另外,大多数CSS是不neccesary。尽管引导程序类“.col-md-4”已经设置了它,但您将宽度宣布为33.3333%。而且浮动也不是必需的,它们应该一个接一个地定位。 – torus
为什么你使用'col-md-offset-1 col-md-10'类来'精选'。它也减少了空间。相反尝试'col-md-12' – DJAy