Problem one, resolution resolution adaptation:
Different screen widths, HTML element aspect ratios and font sizes, the distance between elements is adaptive, using REM units.
Issue two, Unit inch pixel number PPI adaptation:
Using REM units, the text will hollow. Paragraph text, using PX units, with media query or JS to fit. Title text can be directly used in rem units.
Problem three, device pixel scale DPR adaptation:
1 physical pixels in
<meta name= "viewport" content= "initial-scale=1, maximum-scale=1, minimum-scale=1, User-scalable=no" >
The display effect is not required. To modify the scale of the META tag according to Devicepixelratio
Reference:
http://www.html-js.com/article/2402
Http://isux.tencent.com/web-app-rem.html
Https://github.com/amfe/lib.flexible
The demo is as follows:
<!doctype html>//From http://www.cnblogs.com/samwu/p/4285748.htmlMobile H5 Adaptive Layout