css3中font-size PX EM REM 区别使用
这些段落的 line-height 这样计算:2x16px = 32px。
这些段落的 line-height 这样计算:2x16px = 32px。
这些段落的 line-height 这样计算:2x16px = 32px。
这个 div 元素的 font-size 被设置为 30px。div 元素内部的 span 元素的 font-size 为 0.5em,其等于 0.5x30 = 15px。
www.96net.com.cn 此文档的 font-size 是 16px。
这个 div 的 font-size 为 2rem,转换为浏览器字体大小的2倍。
这个 div 元素的 font-size 为 3rem。它同时也展示出不会继承其父元素的字体尺寸。
rem 单位设置的 font-size 相对于浏览器的基准字体尺寸,并不从其父元素继承。