【发布时间】:2017-03-08 11:27:02
【问题描述】:
我正在尝试使用不同的图像创建 Bootstrap 网格布局。一切都很好,除了在 Chrome 上的移动检查器中在不同的移动设备上查看时。下面是它在检查器中的样子的图片。第二张图片与前一张图片略微偏离中心。
<section class="container" id="main">
<section class="center-block text-center">
<h4>Random Column Number 1</h4>
<img src="https://www.apple.com/ac/structured-data/images/open_graph_logo.png?201701231950" width="500px" height="262px"/>
</section>
<section class="col-lg-6 center-block text-center">
<h4>Random Column Number 2</h4>
<img src="http://www.appliste.cz/wp-content/uploads/2016/05/Apple_1998.png" width="500px" height="262px" />
</section>
<section class="col-lg-6 center-block text-center">
<h4>Random Column Number 3</h4>
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/8/84/Apple_Computer_Logo_rainbow.svg/931px-Apple_Computer_Logo_rainbow.svg.png" width="500px" height="262px" />
</section>
</section>
这里是JSFiddle。问题是我试图将第二部分偏移为“col-lg-6 center-block text-center”类。如果我删除 col-lg-6 它工作得很好。但我希望能够将两个图像彼此相邻堆叠。有没有办法纠正这个问题,使它像第一张图片一样居中? JSFiddle 包含三个图像。
【问题讨论】:
标签: html css twitter-bootstrap mobile responsive-images