我想让一张图片适应一个指定大小的div。不幸的是,图片没有符合要求,而是按比例缩小到了一个不够大的尺寸。我不确定最好的方法是什么来使图片适应这个div。
如果这不是足够的代码,我很乐意提供更多,并且我也愿意纠正我所忽视的任何其他错误。
以下是HTML:
<div class="span3 top1">
<div class="row">
<div class="span3 food1">
<img src="images/food1.jpg" alt="">
</div>
</div>
<div class="row">
<div class="span3 name1">
heres the name
</div>
</div>
<div class="row">
<div class="span3 description1">
heres where i describe and say "read more"
</div>
</div>
</div>
我的CSS
.top1{
height:390px;
background-color:#FFFFFF;
margin-top:10px;
}
.food1{
background-color:#000000;
height:230px;
}
.name1{
background-color:#555555;
height:90px;
}
.description1{
background-color:#777777;
height:70px;
}