css - 如何使图像在 div 内响应

标签 css image responsive-design

我的代码如下:

<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代码吗?

我必须在一行中给出 Mobile 中的两张图片和 iPad 中的四张图片!!

最佳答案

这是您需要遵循的代码:

img {
    max-width: 100%;
    height: auto;
    }

引用:http://html5hub.com/html5-picture-element/

关于css - 如何使图像在 div 内响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24695992/

相关文章:

twitter-bootstrap - Bootstrap Card 到新线路响应

css - 调整窗口大小时, Angular 图像不会移动到 Angular

javascript - jQuery 数据表中的responsive.details.renderer() 函数的回调是什么?

html - 将 float 的 div 与父 div 对齐

css - 在 CSS 中使用 FontAwesome

css - 如何重新排列列网格?

html - 图片自动间距?

html - CSS:通过不使用JS的包含图像定义元素的宽度

css - 如何使用伪元素选择指向以 foo 结尾的域的链接?

python - 如何从 opencv 获得准确的 idft 结果?