0

@font-face用来启用自定义字体。它适用于 Firefox、IE、Safari 和 Mac 上的 Chrome。在带有 Chrome 的 Windows 7 上,10 像素的文本看起来是绿色的,而不是黑色或灰色!...经过更多测试:Firefox (Windows) 和 Safari (Windows) 存在同样的问题

也许它与 Windows ClearType 渲染有关。但为什么它可以在 Internet Explorer 中运行?

页面直接链接:http ://www.light-work.de/chrome.html

真的很奇怪!只有 10px 字体大小(我需要的大小)才会出现问题。在light-work.de/webfontkit/您可以看到标本概览。

更大的屏幕截图: http: //light-work.de/styles/02.png

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>google chrome</title>
<style>
/* Generated by Font Squirrel */
@font-face {
    font-family: 'M10Regular';
    src: url('http://light-work.de/styles/m10/m10-webfont.eot');
    src: url('http://light-work.de/styles/m10/m10-webfont.eot?#iefix') format('embedded-opentype'),
         url('http://light-work.de/styles/m10/m10-webfont.woff') format('woff'),
         url('http://light-work.de/styles/m10/m10-webfont.ttf') format('truetype'),
         url('http://light-work.de/styles/m10/m10-webfont.svg#M10Regular') format('svg');
    font-weight: normal;
    font-style: normal;

}


body {
    font-family: 'M10Regular';
    line-height: 20px;
    font-size: 10px;
    color:#666666;
}


</style>
</head>
<body>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
</body>
</html>
4

2 回答 2

0

好吧,您的文本不在正文标记中。所以你的风格不应该被应用(这显然不在 Chrome 中)。问题应该是:为什么所有其他浏览器都在意你的字体设置?:-)

于 2011-05-06T11:43:48.540 回答
0

您的示例网页在 64 位 Windows 7 上使用 Chrome v11.0.696.60 为我呈现灰色(实际上是#666666)。

右键单击您认为不正确的文本以调出上下文菜单。从那里,单击Inspect element。这将打开开发人员工具。他们会帮助你解决你的问题。这就是我所看到的

Chrome 中测试页面的屏幕截图,开发者工具已打开

如您所见,Chrome 正在根据您指定的样式呈现您的页面。

于 2011-05-06T17:48:40.603 回答