简体   繁体   English

IE7文字大小调整

[英]IE7 Text Resizing

I've used pixels to determine the size of my fonts on a website. 我使用像素来确定网站上字体的大小。 All the text resizes fine in Chrome, Firefox etc, using the zoom feature. 使用缩放功能,所有文字在Chrome,Firefox等中的大小都可以调整。 However in IE7 (and IE6/8, I guess) the fonts don't resize using the Text Size menu, they just stay the same. 但是,在IE7(我猜是IE6 / 8)中,字体不会使用“文本大小”菜单来调整大小,而是保持不变。

Now I'm thinking the only solution to this is switching to ems - but is there any solution I could write in JS to target / fix only IE? 现在,我认为对此的唯一解决方案是切换到ems但是有什么我可以用JS编写的解决方案来仅针对IE或定位IE?

Unless you know otherwise, assume that hardly anyone has IE7 or 6 anyway. 除非您另有了解,否则请假设几乎没有人拥有IE7或6。 IE8 has a zoom feature, so that's OK. IE8具有缩放功能,这样就可以了。 On approximately 50 small business sites I have data for, in the last month 0.5% of visitors were using IE6, 4% had IE7 and 12% had IE8. 我有大约50个小型企业网站的数据,上个月有0.5%的访问者使用IE6,4%的访问者使用IE7,12%的访问者使用IE8。

We don't support IE6 or 7, but we do test and check things look basically right there. 我们不支持IE6或7,但我们会进行测试并检查是否基本上就在那儿。

Assuming that you do want to allow this minor feature (assumedly people who need accessibility the most will not be using these notoriously inaccessible browsers!) in IE6 and 7, you do need to use ems rather than px, and you'll really need to use it for everything, not just font-size, as otherwise the boxes won't scale properly either. 假设您确实希望在IE6和7中允许此次要功能(假设最需要辅助功能的人将不会使用这些众所周知的无法访问的浏览器!),则确实需要使用ems而不是px,并且您确实需要将其用于所有内容,而不仅仅是字体大小,否则框也将无法正确缩放。

in internet explorer 6 & 7 you cannot increase or decrease font-size that is set in pixel in your css. 在Internet Explorer 6和7中,您不能增加或减小在CSS中以像素为单位设置的字体大小。

For that to work you have to use EM's as font-size value. 为此,您必须使用EM作为字体大小值。

Read this article 阅读这篇文章

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM