gpt4 book ai didi

html - @Font-face 在 IE 和 fontsquirrel 中的问题修复

转载 作者:太空宇宙 更新时间:2023-11-04 14:58:14 26 4
gpt4 key购买 nike

我能够在 chrome 和 Firefox 中成功使用@font-face,但在 IE 中却不行:

font-family: 'Market_Deco';

src: url('fonts/Market_Deco.ttf');

这在 IE 中不起作用,所以我尝试在转换和添加 EOT 文件后添加这一行:

src: url('fonts/Market_Deco.eot') format ('eot');

那仍然不起作用,所以我删除了 .ttf 引用并只使用 EOT 行。这在 IE 中修复了它并在其他任何地方都破坏了它。我开始看这里,每个人都推荐 font squirrel,所以我试了一下:

@font-face {
font-family: 'market_decoregular';
src: url('fonts/market_deco-webfont.eot');
src: url('fonts/market_deco-webfont.eot?#iefix') format('embedded-opentype'),
url('font/market_deco-webfont.woff') format('woff'),
url('fonts/market_deco-webfont.ttf') format('truetype'),
url('fonts/fontmarket_deco-webfont.svg#market_decoregular') format('svg');
font-weight: normal;
font-style: normal;
}

我将四个新字体文件添加到我的字体文件夹中,更新了 CSS,现在它可以在零浏览器中运行。我在这里遗漏了什么吗?

最佳答案

如果您在样式表中将该字体称为

font-family: 'Market_Deco';

那么它不会调用字体,因为它在您的字体规则中实际上被称为 market_decoregular:

@font-face {
font-family: 'market_decoregular';

如前所述,

url('font/market_deco-webfont.woff') format('woff'),

应该是

url('fonts/market_deco-webfont.woff') format('woff'),

关于html - @Font-face 在 IE 和 fontsquirrel 中的问题修复,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16765134/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com