Pt px em rem, ptpx

Source: Internet
Author: User

Pt px em rem, ptpx
Px

In the initial production of the Web page, we used "px" to set our text, because it is relatively stable and accurate. However, this method has a problem. When a user browses the Web page we created in the browser, the font size of the browser is changed, and the layout of the Web page is broken. This is a big problem for users who care about their website availability. Therefore, we propose to use "em" to define the web page font.

Em

As mentioned above, it is convenient and consistent to use "px", but there will be a problem when you zoom in or zoom in the browser to browse the page. To solve this problem, we can use the "em" unit.

!!!Em is calculated relative to the attributes of the parent element.If you want to calculate the conversion between px and em

RemEM is used to set the font size relative to its parent element. In this case, a problem occurs. You may need to know the size of its parent element for any element settings. And Rem is relative to the root element This means that we only need to determine a reference value in the root element.

 

A px to em URL:

PX to EM

 

Related Article

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.