【问题标题】:CSS font-face font size compatibility issue firefoxCSS font-face 字体大小兼容性问题 firefox
【发布时间】:2012-08-08 21:06:08
【问题描述】:

所以,我设计了一个使用 HTML/CSS 的单页布局。该页面可以在这里找到:

http://letsrob.org/

因此,页面的标题文本是我使用 font-face 属性加载的自定义字体。字体大小和字体在 chrome 上是完美的,但在 Firefox 上更大,有时字体本身看起来有点不同。为什么会这样?整个页面都因为标题字体而被打乱了!

我的字体代码:

@font-face {
    font-family: "logotext";
    src: url(http://letsrob.org/css/BEBAS.ttf) format("truetype");
}
@font-face {
    font-family: "captiontext";
    src: url(http://letsrob.org/css/Franchise-Bold-hinted.ttf) format("truetype");
}

我的标题 CSS 类:

<div id="banner" style="margin-top:20px;color:white;font-weight:bold;font-size:1.75em;font-family:logotext;text-align:center;">Reclaim Our Beaches</div>

<div style="color:white;font-weight:bold;font-size:3em;font-family:captiontext;text-align:center;margin-top:20px;">ROB SYMPOSIUM: Talking trash, Exposing waste</div>

<div style="color:white;font-weight:bold;font-size:1.5em;font-family:captiontext;text-align:center;margin-top:20px;">10AM to 5PM, 18 & 19th AUGUST,2012</div>
<div style="color:white;font-weight:bold;font-size:1.5em;font-family:captiontext;text-align:center;margin-top:10px;">Conference Hall, School of Media Studies, Loyola College, Chennai</div>

请使用 Firefox 访问该页面以查看中断情况。它在 chrome 上运行得非常好!

提前致谢

【问题讨论】:

    标签: html css font-face font-size truetype


    【解决方案1】:

    看起来你的字体中唯一的粗体是粗体。因为你在你的 CSS 中指定了font-weight:bold,所以 Firefox 试图通过扩展字形来自动加粗一个已经粗体的字体。删除该规则可以修复它(并且在我的 Mac 上的 Chrome 中看起来也更好)。

    【讨论】:

    • 那行得通:)。请立即检查链接。不敢相信我错过了这个微小的细节。但是谢谢你:)
    猜你喜欢
    • 2020-04-13
    • 2020-01-28
    • 2012-07-15
    • 2012-03-05
    • 2011-11-16
    • 1970-01-01
    • 2015-12-26
    • 2014-01-21
    • 1970-01-01
    相关资源
    最近更新 更多