WeChat applet Image image achieves 100% width and self-adaptive height
The method is as follows:
1. Image attribute mode="widthFix"
Note: The width does not change, the height changes automatically, and the aspect ratio of the original image remains unchanged.
<image class="img" src="../../images/hello.png" mode="widthFix">
2.css set image width=100%
img{
width: 100%;
}
That's it!
More:
WeChat applet pull-down refresh
Small program mall production, easy to create your own membership system