首页 > 网站 > WEB开发 > 正文

em&&rem

2024-04-27 15:11:25
字体:
来源:转载
供稿:网友

摘自w3c em unit Equal to the computed value of the ‘font-size’ PRoperty of the element on which it is used.

h1 { line-height: 1.2em }

means that the line height of h1 elements will be 20% greater than the font size of h1 element. On the other hand:

h1 { font-size: 1.2em }

means that the font size of h1 elements will be 20% greater than the computed font size inherited by h1 elements.

rem unit Equal to the computed value of ‘font-size’ on the root element.

When specified on the ‘font-size’ property of the root element, the ‘rem’ units refer to the property’s initial value.


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表