CSS's EM flex layout

Source: Internet
Author: User

1, the user's text size and flexible layout

In general, the user's browser default rendering text size is "16px", the key to elastic design is that all elements in the page use "Em" unit value, "em" is a relative size. There is a reference to the relative calculation, so here is relative to the font-size of the element's parent element.

For example:

<div id= "Container" >

</div>

body{font-size:62.5%;-->10px;} #container {font-size:1.2em;-->12px;} h1 {font-size:2.5em;-->30px;} Formula: (1):P Xtoem 1÷ The Font-sizex of the parent element needs to convert the pixel value = em value


CSS's EM flex 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.