【发布时间】:2016-03-07 09:29:47
【问题描述】:
我是网络开发新手,请多多包涵。我必须用一组这样的图像创建一个块:
我尝试使用表格来执行此操作,但最后一列的图像比例不正确。我相信因为行的高度。我设法通过使用rowspan 正确获取了中心图像。我在网上查了很多教程,但找不到中间图像是这样的。我也尝试过使用li。但是失败了。这是我拥有的表格的代码
<table class="home" align="center">
<tr>
<td><img src="http://localhost/sty_partners/img/main_top_left.jpg" alt="" class="img-responsive center-block" >
</td>
<td rowspan ="2"><img src="http://localhost/sty_partners/img/main_center.jpg" alt="" class="img-responsive center-block">
<!--<div class="center" > <p> SPEND MORE <br> time doing what <br> you love</p> </div>-->
</td>
<td><img src="http://localhost/sty_partners/img/main_top_right.jpg" alt="" class="img-responsive center-block"></td>
</tr>
<tr>
<td><img src="http://localhost/sty_partners/img/main_bottom_left.jpg" alt="" class="img-responsive center-block"></td>
<td><img src="http://localhost/sty_partners/img/main_bottom_right.jpg" alt="" class="img-responsive center-block"></td>
</tr>
</table>
这是表格的 CSS:
table.home img{
width:100%; height:100%;}
谁能告诉我该怎么做?
【问题讨论】:
标签: php html css image twitter-bootstrap