为什么font-size在IE7中不起作用

[英]Why doesn't font-size work in IE7


I have to following code fragment, and no matter what I set the font-size to, IE7 doesn't listen at all! All other browsers are working fine. Any ideas?

我必须遵循代码片段,无论我设置什么字体大小,IE7都不会听!所有其他浏览器都运行良好。有任何想法吗?

<html>
<head>
    <title>Test</title>


    <style type="text/css">
        * {margin:0;padding:0;font-size:3em;font-family:Arial;}

    </style>

</head>
    <body>
        <h1>A heading goes here</h1>
    </body>
</html>

4 个解决方案

#1


It should work on every (decent) browser including IE 7.

它应该适用于包括IE 7在内的每个(体面的)浏览器。

I imagine it is an accessibility setting with your Browser, possibly:

我想这是一个浏览器的辅助功能设置,可能:

Tools -> Options -> General tab -> Accessibility -> "Ignore font sizes specified on pages".

工具 - >选项 - >常规选项卡 - >辅助功能 - >“忽略页面上指定的字体大小”。

#2


Try the following:

请尝试以下方法:

a) Use firebug to inspect the style. Overridden styles are struck out in the style view in the right firebug pane when inspecting an element.

a)使用萤火虫检查风格。在检查元素时,在右侧firebug窗格的样式视图中会覆盖重写的样式。

b)

font-size: 3em !important;

c) Try setting the style on the element directly for now, just to test with

c)现在尝试直接在元素上设置样式,只是为了测试

<h3 style='font-size: 10em;'>Test</h3>

#3


The unit "em" is relative to the current font size. Since you install the size for all elements, which template should IE use?

单位“em”与当前字体大小有关。既然你安装了所有元素的大小,IE应该使用哪个模板?

You must specify either the list of elements where the style should apply or use a class.

您必须指定应该应用样式的元素列表或使用类。

#4


try to use commonly used reset.css. * selector will slow down rendering your page. You generally need to reset elements that display as block. http://960gs.com can help you for this purpose.

尝试使用常用的reset.css。 *选择器会降低渲染页面的速度。您通常需要重置显示为块的元素。 http://960gs.com可以帮助您实现此目的。

智能推荐

注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.silva-art.net/blog/2009/05/15/99b0fcd19eac928b8b4c860a1de6e3b9.html



 
© 2014-2019 ITdaan.com 粤ICP备14056181号  

赞助商广告