【发布时间】:2014-01-21 10:55:36
【问题描述】:
@font-face 快把我逼疯了!还有什么新东西?
我的样式表中有这段代码:
@font-face {
font-family: BebasNeue;
src: url('/style/fonts/bebasneue-webfont.svg#bebas_neueregular') format('svg'),
url('/style/fonts/bebasneue-webfont.woff') format('woff'),
url('/style/fonts/bebasneue-webfont.ttf') format ('truetype'),
url('/style/fonts/bebasneue-webfont.eot?#iefix') format('embedded-opentype');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: Quicksand;
src: url('/style/fonts/quicksand-regular-webfont.svg#Quicksand') format('svg'),
url('/style/fonts/quicksand-regular-webfont.woff') format('woff'),
url('/style/fonts/quicksand-regular-webfont.ttf') format('truetype'),
url('/style/fonts/quicksand-regular-webfont.eot?#iefix') format('embedded-opentype');
font-weight: normal;
font-style: normal;
}
流沙加载,贝巴斯没有。我重新下载了字体(来自 Font Squirrel),重新转换,拔掉头发,向 Odin 祈祷......
在 Chrome 的检查器中,我在 Bebas 样式表的 SVG 行上看到“无效的 CSS 属性值,但我看不出这与流沙下的同一行之间有任何区别。在 Chrome 和 FF 中,流沙-常规- webfont.woff 显示在资源下,但是 -surprise!- 不是 bebasneue-webfont.woff。
【问题讨论】:
-
你能链接到一个活生生的例子吗?
-
我相信你可以省略
format(XXX),无论如何,你在format和(之间的第一个.ttf中有一个空格。