歌剧和@font-face
我使用@font-face 将一种字体合并到我的网站中。尽管它在 ff/chome/safari 中显示良好,但在 Opera 中渲染时遇到困难。
我正在使用 Google 的字体 API;这是在我的 html 中:
<link
href='http://fonts.googleapis.com/css?family=Muli'
rel='stylesheet'
type='text/css' >
然后是我的 CSS:
/* this is whats in the linked file */
@font-face
{ font-family: 'Muli';
font-style: normal;
font-weight: 400;
src: local('Muli'), url('http://themes.googleusercontent.com/static/fonts/muli/v2/ kU4XYdV4jtS72BIidPtqyw.woff') format('woff');
}
/* this is the css in my site */
body
{ font-family: 'Muli', sans-serif;
}
我不确定为什么这不起作用:API 说它适用于 Opera 10.5 及更高版本...
I have a font that I've incorporated into my site using @font-face. Even though it displays fine in ff/chome/safari, it's having difficulties rendering in Opera.
I'm using Google's font API; this is in my html:
<link
href='http://fonts.googleapis.com/css?family=Muli'
rel='stylesheet'
type='text/css' >
and then my CSS:
/* this is whats in the linked file */
@font-face
{ font-family: 'Muli';
font-style: normal;
font-weight: 400;
src: local('Muli'), url('http://themes.googleusercontent.com/static/fonts/muli/v2/ kU4XYdV4jtS72BIidPtqyw.woff') format('woff');
}
/* this is the css in my site */
body
{ font-family: 'Muli', sans-serif;
}
I'm not sure why this isn't working: the API says it works with Opera 10.5 and up...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
它是
font-weight:bold;
而不是font-style:bold;
。 font-style 值为“斜体”、“斜体”和“正常”。 font-weight 可以有“粗体”、“粗体” 、“较轻”、“正常”或数值 100、200、...、900。It's
font-weight: bold;
instead offont-style: bold;
. font-style values are "italic", "oblique" and "normal". font-weight can have "bold", "bolder", "lighter", "normal" or the numeric values 100, 200, ..., 900.它是
font-weight:bold
,而不是font-style:bold
。It's
font-weight:bold
, notfont-style:bold
.如果您在 font-face 声明中显式定义
font-weight: 400;
,则该 font-face 将仅用于具有完全相同的 font-weight 的文本。我不确定“400”是否与您在body
选择器中要求的“正常”相同。我希望您的实际字体 URI 中没有空格。
It may be that if you explicitly define
font-weight: 400;
in your font-face declaration, that font-face will only be used for text with exactly that font-weight. I'm not sure if "400" is the same as "normal", which you're asking for in yourbody
selector.That, and I hope there's no whitespace in your actual font URI.
尝试使用双引号:
更多信息请参见:为什么不会Opera (11.00) 显示自定义 (@font-face) 字体?
Try double quotes:
More infos here: Why won't Opera (11.00) display custom (@font-face) fonts?