【发布时间】:2013-08-20 16:59:25
【问题描述】:
我想知道使用 Bootstrap 3 RC2 使用 CSS 在这 3 个图像之间放置空格的最佳方法是,因为我目前所做的不是自动调整图像大小,即使我已将宽度设置为自动在我的#picture id 标签中。我希望他们能够内联并相应地调整图像大小。
这是我的标记:
<div class="container">
<div class="row">
<div class="col-lg-4">
<img src="http://placehold.it/350x250" id="picture" />
</div>
<div class="col-lg-4">
<img src="http://placehold.it/350x250" id="picture" />
</div>
<div class="col-lg-4">
<img src="http://placehold.it/350x250" id="picture" />
</div>
</div>
</div>
CSS:
.container {
max-width:1000px;
background-color:white;
}
body {
background-color:cyan
}
#picture {
width:auto;
/*margin-left:10px; */
/*margin-right:10px; */
}
.col-lg-4 {
margin-left:10px;
margin-right:10px;
}
查看我的Fiddle 以获得更清晰的视图。有没有更好的方法来处理这个问题?
【问题讨论】:
-
offtopic:将 id="picture" 更改为 class="picture"...您可以使用特定 id 一次,多次上课..它不会解决您的问题,但它会让您例子更有效
标签: html css responsive-design twitter-bootstrap-3