Summary of common units in CSS

Source: Internet
Author: User
Today we summarize 15 of the most commonly used units in CSS, in order to help you understand, listed below.

1.PX: Absolute unit, the page is displayed by exact pixel

2.em: Relative units, the reference point is the size of the parent node font, if you define the font-size by itself (the browser default font is 16PX), the entire page 1em is not a fixed value.

3.rem: Relative unit, can be understood as "root em", relative to the root node HTML font size to calculate, CSS3 new attributes, chrome/firefox/ie9+ support.

4.vw:viewpoint width, window width, 1vw equals 1% of the window width.

5.vh:viewpoint height, window height, 1VH equals 1% of the window height.

The smaller of the 6.VMIN:VW and VH.

The larger of the 7.VMAX:VW and VH.

8.%: Percent

9.in: Inch

10.cm: cm

11.MM: MM

12.pt:point, about 1/72 inches

13.pc:pica, about 6PT,1/6 inches

14.ex: The height of the x of the font for the current effect, measured in 0.5em without determining the x height (IE11 and below are not supported, Firefox/chrome/safari/opera/ios safari/android browser4.4 + equal required attribute plus prefix)

15.ch: the "0" character in the font used by the node is the baseline and cannot be found when 0.5em (Ie10+,chrome31+,safair7.1+,opera26+,ios Safari 7.1+,android browser4.4+ Support)

Believe that you have seen these units of the role, more exciting please pay attention to the PHP Chinese network other related articles!

Related reading:

CSS3 a detailed description of the Translate property

CSS3 a detailed description of the Background-size property

Tutorial on using Transform properties in CSS3

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.