@font-face 不起作用
我很难让@font-face 加载这个网站。有谁知道发生了什么事吗?
我尝试使用 font squirrel 中的 css,但这也不起作用,所以我尝试了一个更简单的代码,希望能起作用,但到目前为止还没有运气。
旧的CSS(不起作用)
@font-face {
font-family: 'CartoGothicStdBold';
src: url('CartoGothicStd-Bold-webfont.eot');
src: local('☺'), url('CartoGothicStd-Bold-webfont.woff') format('woff'), url('CartoGothicStd-Bold-webfont.ttf') format('truetype'), url('CartoGothicStd-Bold-webfont.svg#webfontuvgRkG9V') format('svg');
font-weight: normal;
font-style: normal;
}
新的CSS(仍然不起作用)
@font-face {
font-family: 'CartoGothicStdBold';
src: url(css/fonts/CartoGothicStd-Bold.otf) format("opentype");
}
.b-nb {
float: left;
width: 100%;
font-size: 1.25em;
color: grey;
font-family:'CartoGothicStdBold', serif;
}
我在这里测试它: http://drewlepp.com/testing/laa/LAA%20studio/index.html谢谢
!!!
I am having the hardest time getting @font-face to load for this site. Does any one know what is going on?
I tried using the css from font squirrel but that didn't work either so I tried a simpler code hoping that would work, but no luck so far.
OLDER CSS (did not work)
@font-face {
font-family: 'CartoGothicStdBold';
src: url('CartoGothicStd-Bold-webfont.eot');
src: local('☺'), url('CartoGothicStd-Bold-webfont.woff') format('woff'), url('CartoGothicStd-Bold-webfont.ttf') format('truetype'), url('CartoGothicStd-Bold-webfont.svg#webfontuvgRkG9V') format('svg');
font-weight: normal;
font-style: normal;
}
NEWER CSS (still doesn't work)
@font-face {
font-family: 'CartoGothicStdBold';
src: url(css/fonts/CartoGothicStd-Bold.otf) format("opentype");
}
.b-nb {
float: left;
width: 100%;
font-size: 1.25em;
color: grey;
font-family:'CartoGothicStdBold', serif;
}
I am testing it here:
http://drewlepp.com/testing/laa/LAA%20studio/index.html
Thanks!!!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
老问题,但无论如何我都会向你指出正确的答案(以防其他人偶然发现这个问题)
旧的 CSS 对我来说看起来很好。但如果您使用 IE9 并使用私有字体,您会在 IE9 的控制台中看到错误。所以你需要做这个家伙在这里所做的事情: @font-face 适用于 IE8,但不适用于 IE9
Old question, but i'll point you to the correct answer anyway (in case someone else stumbles on this)
The older CSS looks fine to me. But if you're using IE9 and using private font, you'll see an error in IE9's console. So you need to do what this bloke has done here: @font-face works in IE8 but not IE9
试试这个。我在自己的网站上这样使用
try this. I am using like that in my own site