Css @字体在IE10上本地工作,但在服务器上不工作
我已选中,字体文件位于服务器上:Css @字体在IE10上本地工作,但在服务器上不工作,css,font-face,Css,Font Face,我已选中,字体文件位于服务器上: @font-face { font-family: 'DroidSerifRegular'; src: url('fontface/DroidSerif-Regular-webfont.eot'); src: url('fontface/DroidSerif-Regular-webfont.eot?#iefix') format('embedded-opentype'), url('fontface/DroidSerif
@font-face {
font-family: 'DroidSerifRegular';
src: url('fontface/DroidSerif-Regular-webfont.eot');
src: url('fontface/DroidSerif-Regular-webfont.eot?#iefix') format('embedded-opentype'),
url('fontface/DroidSerif-Regular-webfont.woff') format('woff'),
url('fontface/DroidSerif-Regular-webfont.ttf') format('truetype'),
url('fontface/DroidSerif-Regular-webfont.svg#DroidSerifRegular') format('svg');
src: local('☺'),
url('fontface/DroidSerif-Regular-webfont.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'DroidSerifItalic';
src: url('fontface/DroidSerif-Italic-webfont.eot');
src: url('fontface/DroidSerif-Italic-webfont.eot?#iefix') format('embedded-opentype'),
url('fontface/DroidSerif-Italic-webfont.woff') format('woff'),
url('fontface/DroidSerif-Italic-webfont.ttf') format('truetype'),
url('fontface/DroidSerif-Italic-webfont.svg#DroidSerifItalic') format('svg');
src: local('☺'),
url('fontface/DroidSerif-Italic-webfont.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
编辑:奇怪的是,字体在IE8中显示正确,但在IE9或IE10中显示不正确
我还尝试:
@font-face {
font-family: 'DroidSerifRegular';
src: local('☺'),
url('http://www.mysite.ca/themes/mysite/fontface/DroidSerif-Regular-webfont.eot?#iefix') format('embedded-opentype'),
url('http://www.mysite.ca/themes/mysite/fontface/DroidSerif-Regular-webfont.woff') format('woff'),
url('http://www.mysite.ca/themes/mysite/fontface/DroidSerif-Regular-webfont.ttf') format('truetype'),
url('http://www.mysite.ca/themes/mysite/fontface/DroidSerif-Regular-webfont.svg#DroidSerifRegular') format('svg');
font-weight: normal;
font-style: normal;
}
以及我的.htaccess:
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>
尝试删除此部分:
local('☺')
或者在这部分也添加其他字体,如
src: local('☺'),
url('GraublauWeb.woff') format('woff'), url('GraublauWeb.ttf') format('truetype');
你们能确认服务器上也有这些字体吗
尝试使用此工具创建yout字体:
选择“专家”控制选项,并将“EOT Compressed”更改为“EOT Lite”尝试删除此部分:
local('☺')
或者在这部分也添加其他字体,如
src: local('☺'),
url('GraublauWeb.woff') format('woff'), url('GraublauWeb.ttf') format('truetype');
你们能确认服务器上也有这些字体吗
尝试使用此工具创建yout字体:
选择“专家”控制选项,并从“EOT Compressed”更改为“EOT Lite”我在IIS服务器上遇到了相同的问题,最后意识到,我必须将mime类型woff添加到ISS,以便交付文件。其他浏览器似乎支持其他文件类型,因此当他们无法访问woff时,他们会使用其他浏览器,但ie11需要woff。我在IIS服务器上遇到了同样的问题,最后意识到,我必须将mime类型woff添加到ISS,以便交付文件。其他浏览器似乎支持其他文件类型,因此当他们无法访问woff时,他们会选择其他浏览器,但ie11需要woff。8之前的IIS服务器版本在默认情况下似乎没有添加mime类型woff。将它添加到列表服务器>您的站点>mime类型中,您就可以了。这至少为我解决了IE11中的CSS3114错误。FF和Chrome从来没有遇到过问题,因为它们在这一点上似乎没有那么严格。8之前的IIS服务器版本在默认情况下似乎没有添加mime类型woff。将它添加到列表服务器>您的站点>mime类型中,您就可以了。这至少为我解决了IE11中的CSS3114错误。FF和Chrome从来没有遇到过问题,因为它们在这一点上似乎没有那么严格。有时候url必须占据文件的整个路径。这一点很好。我刚试过,但它仍然不起作用…它没有默认为web字体…它只是看起来很奇怪、很瘦而且有别名。你的服务器的.htaccess看起来像什么?我假设你在apache上。我隐约记得有类似的问题。如果我没记错的话,对我来说,字体文件确实有问题。在我的例子中,我不得不要求字体提供商myfonts.com为我重新生成字体文件。奇怪的是,它在我将文件上传到服务器之前工作,这意味着,在我的计算机上本地…?有时url必须占据文件的整个路径。这一点很好。我刚试过,但它仍然不起作用…它没有默认为web字体…它只是看起来很奇怪、很瘦而且有别名。你的服务器的.htaccess看起来像什么?我假设你在apache上。我隐约记得有类似的问题。如果我没记错的话,对我来说,字体文件确实有问题。在我的例子中,我不得不要求字体提供商myfonts.com为我重新生成字体文件。奇怪的是,在我将文件上传到服务器之前,它就工作了,在我的计算机上本地…?我在每个URL中键入所有字体以进行检查尝试使用此工具创建yout字体:您是否尝试选择“expert”控制选项并从“EOT Compressed”更改为“EOT Lite”?我在每个URL中键入所有字体以进行检查尝试使用此工具创建yout字体:您是否尝试选择“expert”控制选项并从“EOT Compressed”更改为“EOT Lite”?