Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【2021-07-16】css的单位有哪些? #9

Open
superDCH opened this issue Jul 16, 2021 · 1 comment
Open

【2021-07-16】css的单位有哪些? #9

superDCH opened this issue Jul 16, 2021 · 1 comment
Labels

Comments

@superDCH
Copy link
Owner

No description provided.

@superDCH superDCH added the css label Jul 16, 2021
@superDCH
Copy link
Owner Author

(一)绝对单位

(1)em

基准点为父节点字体的大小,最初是指字母M的宽度,故名em。现指的是字符宽度的倍数,用法类似百分比,如:0.8em, 1.2em,2em等。

(2)rem

rem rem 是根 em(root em)的缩写,rem作用于非根元素时,相对根节点html的字体大小来计算;rem作用于根元素字体大小时,相对于其出初始字体大小。

(3)vw

vw viewpoint width,视窗宽度,1vw=视窗宽度的1%

(4)vh

viewpoint height,视窗高度,1vh=视窗高度的1%

(4)vmin

vw和vh中较小的那个。

(5)vmax

vw和vh中较大的那个。

(6)ex

依赖于英文字母小 x 的高度

(7)ch

数字 0 的宽度

(二)相对单位

(1)px

像素

(2)cm

厘米

(3)in

英寸 (1in = 96px = 2.54cm)

(4)pt

point,大约1/72英寸; (1pt = 1/72in)

(5)pc

pica,大约 12pt,1/6英寸; (1pc = 12 pt)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant