gpt4 book ai didi

css - IE8中1em是多少像素?

转载 作者:技术小花猫 更新时间:2023-10-29 11:05:42 26 4
gpt4 key购买 nike

1em 不是应该在所有浏览器中都是 16px 吗?

我有这个 CSS

* {font-size: 1em; }
label { font-size: .85em; }

奇怪的是,在 IE8 上,标签元素的高度为 12px,而我希望的是 13.6px。

最佳答案

Isn't 1em supposed to be 16px across all browsers?

不一定:

One 'Em'(1em) is equal to the height of the capital letter "M" in the default font size. When applied in CSS, the Em represents either the user's default font size, or the size of the parent element's font size, if one is available.

因此,虽然默认字体大小为 16px,但您可能在 IE 上设置了不同的大小。

你也可能有一些模糊的父元素覆盖它。

More info

关于css - IE8中1em是多少像素?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9548289/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com