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