.htaccess @字体在FireFox中仍然无法使用。字体类型有问题吗?
我知道有人问过这个问题,但我尝试过上述解决方案,但没有任何影响 我的CSS声明如下所示:.htaccess @字体在FireFox中仍然无法使用。字体类型有问题吗?,.htaccess,css,firefox,fonts,.htaccess,Css,Firefox,Fonts,我知道有人问过这个问题,但我尝试过上述解决方案,但没有任何影响 我的CSS声明如下所示: @font-face { font-family: gillsans; src: url('gillsans.TTF'); } 这适用于Chrome,但不适用于FireFox 奇怪的是,我的另一个网站使用了完全相同的声明,但使用了不同的字体,效果很好: @font-face { font-family: bebas; src: url('bebas.
@font-face {
font-family: gillsans;
src: url('gillsans.TTF');
}
这适用于Chrome,但不适用于FireFox
奇怪的是,我的另一个网站使用了完全相同的声明,但使用了不同的字体,效果很好:
@font-face
{
font-family: bebas;
src: url('bebas.TTF');
}
这可能与实际的字体文件有关吗
我还尝试按照建议修改.htaccess文件:
AddType font/ttf .ttf
AddType font/eot .eot
AddType font/otf .otf
AddType font/woff .woff
<FilesMatch "\.(ttf|otf|eot)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>
AddType字体/ttf.ttf
AddType字体/eot.eot
AddType字体/otf.otf
AddType字体/woff.woff
标题集访问控制允许原点“*”
在FireFox中同样没有结果
我尝试将.TTF
更改为.tff
,并提供文件的绝对路径,但仍然没有
有人能给我一些建议吗
唯一可能的事情是,这个网站正在开发中,因此使用了一个临时URL,但我不明白这会产生什么影响。所以我下载了另一个版本的Gill Sans(仍然是ttf),并替换了我拥有的修复它的版本。奇怪。尝试其他字体类型,如eot、woff和svg。要转换,您可以使用 然后在样式或css文件中尝试以下代码:
<style type="text/css">
@font-face {
font-family:'bebas';
src:url('bebas.eot');/*IE9 or later*/
src:local('bebas'),/*check for font installation*/
local('b ebas'),/*check for font installation in some browsers like Safari*/
url('bebas.eot?#iefix') format('embedded-opentype'),/*hack for IE8 or earlier*/
url('bebas.woff') format('woff'),/*new browsers*/
url('bebas.ttf') format('truetype'),/*all browsers excpet IE*/
url('bebas.svg#bebas') format('svg');/*old iOs*/
}
.bebas-ft{
font-family:bebas, Tahoma, Geneva, sans-serif;
}
</style>
@字体{
字体系列:'bebas';
src:url('bebas.eot');/*IE9或更高版本*/
src:local('bebas'),/*检查字体安装*/
本地('b ebas'),/*检查某些浏览器(如Safari)中的字体安装*/
url('bebas.eot?#iefix')格式('embedded-opentype'),/*针对IE8或更早版本的hack*/
url('bebas.woff')格式('woff'),/*新浏览器*/
url('bebas.ttf')格式('truetype'),/*除IE以外的所有浏览器*/
url('bebas.svg#bebas')格式('svg');/*旧iOs*/
}
贝巴斯堡酒店{
字体系列:贝巴斯,塔荷马,日内瓦,无衬线;
}
也不要为了这么简单的事情修改你的.htaccess文件