@font-face 不起作用

发布于 2024-10-06 05:15:02 字数 960 浏览 0 评论 0原文

我很难让@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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

岁月流歌 2024-10-13 05:15:02

老问题,但无论如何我都会向你指出正确的答案(以防其他人偶然发现这个问题)

旧的 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

一生独一 2024-10-13 05:15:02
@font-face {
    font-family: 'Tangerine';
    src: local('Tangerine'), url('/fonts/Tangerine_Regular.ttf') format('truetype');
}

试试这个。我在自己的网站上这样使用

@font-face {
    font-family: 'Tangerine';
    src: local('Tangerine'), url('/fonts/Tangerine_Regular.ttf') format('truetype');
}

try this. I am using like that in my own site

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文