css – IE8中1em的像素数是多少?

在所有浏览器中,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

相关文章

Css3如何实现鼠标移上变长特效?(图文+视频)
css3怎么实现鼠标悬停图片时缓慢变大效果?(图文+视频)
jquery如何实现点击网页回到顶部效果?(图文+视频)
css3边框阴影效果怎么做?(图文+视频)
css怎么实现圆角边框和圆形效果?(图文+视频教程)
Css3如何实现旋转移动动画特效