61,112
社区成员
发帖
与我相关
我的任务
分享
<div>
<div class="InList_left">
<img src="img/logo.jpg">
</div>
<div class="clearfix"></div>
</div>
.InList_left
{
width: 30%;
border: 1px solid #f4f3f3;
float: left;
}
.InList_left img
{
width: 100%;
}
.InList_left
{
width: 30%;
border: 1px solid #f4f3f3;
float: left;
height:30%;//根据需要把高度调整为合适的,图片的大小就设置为width:100%;height:100%;
}
.InList_left img
{
width: 100%;
}
.InList_left
{
width: 30%;
border: 1px solid #f4f3f3;
float: left;
height:30%;//根据需要把高度调整为合适的,图片的大小就设置为width:100%;height:100%;
}
.InList_left img
{
width: 100%;
}
[/quote]
还是不行,不同尺寸图片下 高度还是不一致。[/quote]
使用rem单位吧
.InList_left
{
width: 30%;
border: 1px solid #f4f3f3;
float: left;
height:30%;//根据需要把高度调整为合适的,图片的大小就设置为width:100%;height:100%;
}
.InList_left img
{
width: 100%;
}
[/quote]
还是不行,不同尺寸图片下 高度还是不一致。
.InList_left
{
//这个盒子的宽高用EM。
}
.InList_left img
{
width: 100%;
height:100%
}