@font-face 在 IE10 上本地工作,但在服务器上不起作用

2024-02-13

我检查了一下,字体文件在服务器上:

@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>

另一个编辑:

我刚刚检查 IE,收到以下消息:

CSS3114: @font-face failed OpenType embedding permission check. Permission must be Installable

尝试删除这部分:

local('☺')

或者也在此部分添加其余字体,例如

src: local('☺'),
url('GraublauWeb.woff') format('woff'), url('GraublauWeb.ttf') format('truetype');

您能否确认服务器上也有所有这些字体?


尝试使用此工具来创建您的字体:http://www.fontsquirrel.com/tools/webfont-generator http://www.fontsquirrel.com/tools/webfont-generator

选择“专家”控制选项并将“EOT 压缩”更改为“EOT Lite”

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

@font-face 在 IE10 上本地工作,但在服务器上不起作用 的相关文章

  • Bootstrap 3 按钮之间的空间

    如果我将几个 Bootstrap 3 按钮排成一行
  • 内部样式表中的 HTML 注释标签[重复]

    这个问题在这里已经有答案了 可能的重复 注释掉 HTML 文档中的样式表以支持旧版浏览器 https stackoverflow com questions 6825773 commenting out stylesheets in htm
  • 如何将 ng-repeat 分成批次

    我正在做这个 ref checkbox 示例http getbootstrap com javascript buttons examples http getbootstrap com javascript buttons example
  • 如何使用 CSS 绘制一个向左的三角形?

    我已经很久没有建造这个向上的三角形了 我怎样才能改变我的 CSS 使角指向左边 http jsfiddle net 3sP8q http jsfiddle net 3sP8q left corner width 0 height 0 bor
  • Chrome 中的混合混合模式问题

    我一直在尝试在包含 css 不透明度过渡实例的页面上使用混合混合模式 似乎正在发生的情况是 包含 mix blend mode 的 div 在过渡期间 或者更确切地说 在动画进行过程中 显示得与没有混合模式时一样 我只发现这是 Chrome
  • 固定 CSS 导航栏

    我最近解决了困扰我一段时间的 CSS 导航栏问题 现在我遇到了将其固定到顶部的问题 以便当您滚动页面时它会向下滚动 我知道我需要添加的是 Position fixed 但我不知道在哪里添加它 我最近的尝试导致文本被修复 但导航栏的背景却没有
  • 使用 jquery 触发 css3 关键帧

    我写了一个关键帧动画 webkit keyframes cubemove 0 webkit transform translateZ 194px rotateY 0deg 20 webkit transform translateZ 194
  • 两个单独表格上的 Td 高度

    我有两个单独的表 我在每个 tr 上使用焦点 悬停函数 该函数同时在两个表上都很好用 我的问题是 td 高度 因为如果第一个表中 td 的描述更大 将显示在中的两行上相同的td和td的高度将被修改 但仅限于第一个表td 如何记住第一个表中
  • 在原始颜色和设置颜色之间设置动画背景

    我有带有随机初始背景颜色的 HTML 元素 我需要在原始 初始 和新元素之间对选定元素的背景颜色进行动画处理 我一直在尝试使用 keyframes blink red 0 background color initial color ini
  • 管道符 (|) 和脱字符号 (^) 属性选择器有什么区别?

    At W3学校 http en wikipedia org wiki W3Schools他们声明两者 http www w3schools com cssref sel attribute value lang asp and http w
  • 角度错误:冲突:多个资源向同一文件名 file.svg 发出不同的内容

    我有这个css in my component scss file bg background url assets images file svg center center no repeat 并且该路径中只有一个 svg 文件 因此每
  • 工具提示未显示在 fontawesome 图标按钮上

    我有一个很棒的图标嵌套在 a 中 但工具提示没有弹出 i class fa fa random title some tooltip i style i fa display inline block 如果您使用的工具提示插件使用 befo
  • 这个 jQuery 选择器中的“>”是什么意思?

    大于号 gt 在这里制作 Is someElement find gt someAttribute 与 someElement find someAttribute 否 它仅选择一个元素 如果它是以下元素的直接子元素 someElement
  • CodeIgniter 中的 base_url() 和 403 错误

    在 HTML 视图中 css 链接代码如下所示 但我的浏览器显示的地址具有双域地址 www jedendzien pl www jedendzien pl assets css style css 所以我收到 403 错误 我通过以下方式创
  • 如何使 Twitter bootstrap 模式全屏

    div class modal hide fade div class modal body div div 如何为上面的代码制作一个 Twitter 引导模式弹出全屏 我尝试使用 css 但无法按照我想要的方式得到它 任何人都可以帮我吗
  • 使用 CSS 和 JQuery 创建组织结构图结构

    I was checking on stack forum Trees in Twitter Bootstrap https stackoverflow com questions 11167628 trees in twitter boo
  • 自定义 CSS 不适用于 Bootstrap

    首先我想说 我知道我的 HTML 并不是最高效或最干净的 我的问题是我编写的自定义 CSS 根本不适用于我的网页 Bootstrap 似乎工作得很好 但是当我尝试进行任何编辑或覆盖 Bootstrap 时 它完全不起作用 我知道我的自定义
  • 显示地址栏时的 100vh 高度 - Chrome Mobile

    I came across this problem a few times and was wondering if there was a solution to this problem My problem occurs on th
  • CSS悬停边框而不调整图像大小

    我想问一下 在不调整图像大小的情况下 我的悬停边框下方功能做错了什么 我已按照给出的指南进行操作here https css tricks com image rollover borders that do not change layo
  • 使用 CSS 内容添加 HTML 实体

    你如何使用CSS content要添加的属性HTML实体 使用这样的东西只是打印 nbsp 到屏幕而不是不间断空格 breadcrumbs a before content nbsp 您必须使用转义的 unicode Like breadc

随机推荐