Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the common units in css3

Shulou Source: shulou.com Published: 2022-06-01 06:55:31 11月12日 Update

This article mainly introduces "what are the common units in css3". In daily operation, I believe many people have doubts about what are the common units in css3. Xiaobian consulted all kinds of information and sorted out simple and easy operation methods. I hope to help you answer the doubts about "what are the common units in css3"! Next, please follow the small series to learn together!

1.px: Absolute units, pages displayed in precise pixels

2.em: Relative unit. The reference point is the font size of the parent node. If font-size is defined by itself, it will be calculated according to itself (the default font of browser is 16px). 1em is not a fixed value in the whole page.

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

vw: Viewpoint width, window width, 1vw = 1% of window width.

vh: Viewpoint height, window height, 1vh = 1% of window height.

vmin: The smaller of vw and vh.

vmax: The larger of vw and vh.

8.%: percentage

9.in: inch

10.cm: cm

11.mm: mm

12.pt point, approximately 1/72 inch

13.pc:pica, approximately 6pt, 1/6 inch

14.ex: take the height of x of the font currently working, calculate it as 0.5em if x height cannot be determined (IE11 and below are not supported, firefox/chrome/safari/opera/ios safari/android browser4.4+ and other attributes are required plus no prefix)

15.ch Based on the "0" character in the font used by the node, 0.5em(ie10+,chrome31+, safair7.1 +,opera26+,ios safari 7.1+,android browser4.4+ support)

At this point, the study of "what are the common units in css3" is over, hoping to solve everyone's doubts. Theory and practice can better match to help you learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!

Tags: Units fonts common windows height learning nodes support datum size width properties more pages help practical accurate larger next function Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology NVidia Redmi MariaDB MySQL