Mobile H5 Adaptive Layout

Source: Internet
Author: User

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.html

Mobile H5 Adaptive Layout

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.