简体   繁体   English

CSS字体 - 字体大小兼容性问题firefox

[英]CSS font-face font size compatibility issue firefox

So, I've designed a single page layout using HTML/CSS. 所以,我使用HTML / CSS设计了单页面布局。 The page can be found here: 该页面可在此处找到:

http://letsrob.org/ http://letsrob.org/

So, the header text of the page is a custom font that I've loaded using the font-face property. 因此,页面的标题文本是我使用font-face属性加载的自定义字体。 The font-size and face are perfect on chrome, but the size is bigger on firefox, and sometime, the font itself looks a bit different. font-size和face在chrome上是完美的,但在firefox上的大小更大,有时,字体本身看起来有点不同。 Why is this so? 为什么会这样? The whole page gets disrupted because of the header font alone! 整个页面因为单独的标题字体而中断!

My Font-face code: 我的字体代码:

@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");
}

My header CSS classes: 我的标题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>

Please visit the page using firefox to see the disruption. 请使用firefox访问该页面以查看中断情况。 It works perfectly fine on chrome! 它在铬上工作得非常好!

Thanks in advance 提前致谢

It looks like the only weight in your font is bold. 看起来你字体中唯一的重量是粗体。 Because you've specified font-weight:bold in your CSS Firefox is trying to auto-bold an already bold typeface by expanding the glyphs. 因为您在CSS中指定了font-weight:bold ,Firefox会尝试通过扩展字形来自动加粗已经粗体的字体。 Removing that rule fixes it (and also looks nicer in Chrome on my Mac). 删除该规则会修复它(在Mac上的Chrome中看起来也更好)。

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

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