gpt4 book ai didi

css - @font-face 在 IE Internet Explorer 中不工作

转载 作者:行者123 更新时间:2023-11-28 08:11:36 25 4
gpt4 key购买 nike

我在使用客户站点时遇到问题。该站点位于 http://allisonbraun.com/sexified-sisterhood/。也可以通过从 http://sexifiedsuccesscircle.com 重定向访问

我用来集成 Pepita Script 字体的 @font-face 规则似乎没有被 Internet Explorer 11 采用,我很困惑。我在代码中做错了什么吗?

以前我遇到过这样的问题,即当通过重定向访问时,规则在 firefox 中不起作用,因为它不喜欢字体托管在不同域下的事实。我已经设法通过添加

来解决这个问题
# BEGIN REQUIRED FOR WEBFONTS

AddType font/ttf .ttf
AddType font/eot .eot
AddType font/otf .otf
AddType font/woff .woff

<FilesMatch "\.(ttf|otf|eot|woff)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>

# END REQUIRED FOR WEBFONTS

到htaccess。它现在在 firefox 中工作,但在 IE 中它仍然不起作用,无论我从哪个 url 访问?

如有任何帮助,将不胜感激!也许我只是愚蠢并且错误地集成了代码,但它似乎在其他任何地方都有效。

最好的,菲翁

最佳答案

您似乎只使用了字体中的 .ttf 文件。尝试使用像 FONTSQUIRREL 这样的字体生成器来转换您的字体并以该格式导入它(Fontsquirrel 为您生成 CSS,只需修改路径并使用它):

@font-face {
font-family: 'FONTNAME';
src: url('path_to_font.eot');
src: url('path_to_font.eot?#iefix') format('embedded-opentype'),
url('path_to_font.woff2') format('woff2'),
url('path_to_font.woff') format('woff'),
url('path_to_font.ttf') format('truetype'),
url('path_to_font.svg#fontname') format('svg');
font-weight: normal;
font-style: normal;
}

关于css - @font-face 在 IE Internet Explorer 中不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29237532/

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