我的代码如下:
<div class="abc">
<div class="bcd">
<a href="#">
<img class="img1" width="50" height="50"/>
</a>
<a>
<h3>Some Text</h3>
</a>
</div>
<div class="bcd">
<a href="#">
<img class="img1" width="50" height="50"/>
</a>
<a>
<h3>Some Text</h3>
</a>
</div>
<div class="bcd">
<a href="#">
<img class="img1" width="50" height="50"/>
</a>
<a>
<h3>Some Text</h3>
</a>
</div>
<div class="bcd">
<a href="#">
<img class="img1" width="50" height="50"/>
</a>
<a>
<h3>Some Text</h3>
</a>
</div>
</div>如何使图像响应移动设备(360X640px)和iPad(768X1024px)?你能给我CSS代码吗?
我必须给两个图片在手机和四个在iPad在一行!
发布于 2014-07-11 18:55:35
以下是您需要遵循的代码:
img {
max-width: 100%;
height: auto;
}参考:http://html5hub.com/html5-picture-element/
发布于 2014-07-11 18:58:13
从img标记中删除width和height属性,并添加此图像max-width:100%; width:100%;的CSS文件
发布于 2017-04-10 03:27:55
在div中设置要设置为背景图像的图像,并将背景大小设置为封面
background-image: url('YOUR URL');
background-size: cover;https://stackoverflow.com/questions/24695992
复制相似问题