em 和 px 字体大小的区别
我在 w3school - font-size 属性中读到使用 em< 之间的区别/code> 和
px
是使用 px 时 IE 不支持调整大小,但 em 支持。
我正在使用 IE7,它可以很好地处理 px 并在缩放页面时重新调整文本大小。
谁能向我解释一下吗?
I read in w3school - font-size property that the difference between using em
and px
is that when using px IE doesn't support resizing but em does.
I am working on IE7 and it works fine with px and re-size the text when zooming the page.
can any one explain this to me ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
px 也可以在 IE 中调整大小。 em 是其父元素继承的大小的相对大小,实际上与 % 具有相同的含义。
我认为使用 em 代替 px 无法获得任何优势。
px can be resized in IE as well. em is a relativ size to the inherited size by it's parent element and actually has the same meaning as %.
I don't think you can take any advantage by using em instead of px.
我相信旧版本的 Internet Explorer 存在此问题,但新版本已修复它。顺便说一句,W3Schools 通常被认为是不好的资源。
I believe old versions of Internet Explorer have this problem, but new versions fixed it. By the way, W3Schools is often considered a bad resource.
根据记忆,IE7将缩放/缩放整个页面,但如果您从菜单中选择“页面/文本大小”来更改文本大小,即当px或其他绝对单位不缩放而相对单位(例如:em)时是。
我希望您正在执行缩放而不是页面/文本大小?
From memory, IE7 will scale / zoom the whole page, but if you select "Page/Text Size" from the menu to change the text size, that is when px or other absolute units are not scaled whereas relative units (eg: em's) are.
I expect you are doing a zoom rather than a Page/Text Size?