We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
相同点:px 和 em 都是长度单位
px
em
异同点:px 的值是固定的,指定是多少就是多少,计算比较容易。
em 的值不是固定的,并且 em 会继承父级元素的字体大小。
浏览器的默认字体高都是 16px。所以未经调整的浏览器都符合: 1em=16px。 那么 12px=0.75em, 10px=0.625em。
16px
1em=16px
12px=0.75em, 10px=0.625em
The text was updated successfully, but these errors were encountered:
Similarities: px and em are both units of length
Similarities and differences: the value of px is fixed.
The value of em is not fixed, and em inherits the font size of the parent element.
The default font height in the browser is 16px. So all untuned browsers are compliant: 1em=16px. So 12px=0.75em, 10px=0.625em.
Sorry, something went wrong.
No branches or pull requests
相同点:
px
和em
都是长度单位异同点:px 的值是固定的,指定是多少就是多少,计算比较容易。
em
的值不是固定的,并且em
会继承父级元素的字体大小。浏览器的默认字体高都是
16px
。所以未经调整的浏览器都符合:1em=16px
。那么
12px=0.75em, 10px=0.625em
。The text was updated successfully, but these errors were encountered: