Wechat applet image images are highly adaptive

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

WeChat applet rich-text rich text image adaptive processing

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325377781&siteId=291194637