实现图片自适应, 按照一般情况只需设置:
- img {
- width: 100%;
- height: auto;
- }
但是微信小程序里是特例, 需要 image 标签上设置属性 mode=widthFix, 就是 height:auto 的作用, CSS 同样设置 width:100%, 如下:
- image {
- width: 100%;
- }
- <image mode='widthFix'></image>
转 : https://blog.csdn.net/Mo_zifeng/article/details/89517510
来源: http://www.bubuko.com/infodetail-3337693.html