px,em和ex之间有什么区别? [英] What is the difference between px, em and ex?
本文介绍了px,em和ex之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
px
, em
与 ex
?当您在CSS中定义font-size时,是否使用 px
, pt
或 em
What is the difference between px
, em
and ex
? And when you define font-size in CSS, do you use px
, pt
or em
?
推荐答案
- 像素(
px
)是依赖于浏览器的。这是您在屏幕上看到的绝对大小。 -
Em
类似于百分比。Em
s是指基本文本大小。1 em
的值表示与100%
的值相同的值。但您也可以用相反的方式说:百分比值只是em
乘以100。 - 点数c $ c> pt )是您要在平面媒体中使用的内容。
- Pixels (
px
) are browser dependent. It is the absolute size that you would see on your screen. Em
are sort of like percentages.Em
s is referring to the base text size. The value of1 em
means the same thing as a value of100 percent
. But you can also say it in the opposite way: A percentage value is just anem
multiplied by 100.- Points(
pt
) are what you would want to use in print media.
这篇关于px,em和ex之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文