Loading... ## 绝对长度单位 ## 1. cm 厘米 1cm = 96px/2.54 2. mm 毫米 1mm = 1/10th of 1cm 3. Q 四分之一毫米 1Q = 1/40th of 1cm 4. in 英寸 1in = 2.54cm = 96px 5. pc 十二点活字 1pc = 1/16th of 1in 6. pt 点 1pt = 1/72th of 1in 7. px 像素 1px = 1/96th of 1in <div class="tip inlineBlock success"> 这里面最多会使用的就是px(像素) </div> ## 相对长度单位 ## 1. em 在 font-size 中使用是相对于父元素的字体大小,在其他属性中使用是相对于自身的字体大小,如 width 2. rem 在排版属性中,相对于根元素的字体大小 3. ex 字符“x”的高度 4. ch 数字“0”的宽度 5. rem 根元素的字体大小 6. lh 元素的line-height 7. vw 视窗宽度的1% 8. vh 视窗高度的1% 9. vmin 视窗较小尺寸的1% 10. vmax 视图大尺寸的1% Last modification:July 26, 2021 © Allow specification reprint Support Appreciate the author AliPayWeChat Like 如果觉得我的文章对你有用,请随意赞赏