1
我有一個畫廊,縮略圖的寬度設置爲100%。然而一些圖像並不能填充這個div的全部高度。彈力圖像分格
我該如何獲得它,使圖像伸展在div的全部寬度和高度? (不能更改爲背景圖像)
<div class="gallery-grid">
<div class="section group">
<div class="col span_1_of_6">
<a href="javascript: changeImage(1);"><img src="images/flowers.jpg" alt="" /></a>
</div>
<div class="col span_1_of_6">
<a href="javascript: changeImage(2);"><img src="images/back.jpg" alt="" /></a>
</div>
<div class="col span_1_of_6">
<a href="javascript: changeImage(3);"><img src="images/flowers.jpg" alt="" /></a>
</div>
<div class="col span_1_of_6">
<a href="javascript: changeImage(4);"><img src="images/back.jpg" alt="" /></a>
</div>
<div class="col span_1_of_6">
<a href="javascript: changeImage(5);"><img src="images/flowers.jpg" alt="" /></a>
</div>
<div class="col span_1_of_6">
<a href="javascript: changeImage(6);"><img src="images/back.jpg" alt="" /></a>
</div>
</div>
<!--style-->
.gallery-grid img{
width:100%;
}
執行縮略圖都具有相同的高度/寬度比α –