Summary of the mobile end

Source: Internet
Author: User

Test demo on GitHub: Https://github.com/fei1314/mobileDesign/tree/master

One, mobile 1.viewport (viewport): Based on the resolution of the browser adaptive<Metaname= "Viewport"content= "width=device-width,user-scalable=no,initial-scale=1.0">width=device-width: Width equals the width of the device, depending on the device user-scalable=no:user-scalable whether the user is allowed to scale, his value is a Boolean value, no means that the user is not allowed to scale the page Initia      L-scale=1.0: Represents the initial scaling Minimum-scale: Minimum scaling Maximum-scale: Maximum zoom ratio 2. New Box Model Box-sizing:border-box/content-box    Border-box:width/height including border padding Content-box:width/height does not include border padding 3. Elastic box Model Parent: Display:flex;     Child: Flex:1 principle: Available total width-fixed occupied width = remaining space remaining space *flex/flex_sum=width 4. Media query @media (condition) {CSS code//Note Priority} 5.rem rem relative root element font size (HTML) EM relative font size font-size:12px;      Width:2em = width:24px;          Goal: All things can follow the size of the screen (as simple as possible) method: All the dimensions are written in rem, only need to change the fontsize principle of HTML: for different devices, the width is different, a datum screen is needed to calculate the width of the corresponding devices according to different devices.                          If the base screen width is 375px (as you decide), the HTML font size is 20px (as you set it). The true width of the known device clientwidth, according to the corresponding law, can calculate the corresponding true width of the font size datum screen Real screen width 375 clientwidth font?

Summary of the mobile end

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.