@font-face 在 Firefox 中不起作用?

2024-03-12

这是由 FontSquirrel 生成的代码,在所有其他浏览器(包括 IE)中都可以正常工作,但在强大的 Firefox 中却不行!我究竟做错了什么?

(ps-我使用的是FF3.5)

如果您无法查看我的示例,请参阅以下来源:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex, nofollow" />
<title>Fonts Firefox test</title>

<style type="text/css">
/*********** CHEVIN @font-faces **********/
@font-face {
font-family: ChevinLight;
src: url(uploads/fonts/chevilig-webfont.ttf);
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: ChevinBold;
src: url(uploads/fonts/chevibol-webfont.ttf);
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: ChevinExbold;
src: url(uploads/fonts/cheviextbol-webfont.ttf);
font-weight: normal;
font-style: normal;
}

/*********** @font-faces FOR IE **********/
@font-face {
font-family: ChevinLight;
src: url(uploads/fonts/chevilig-webfont.eot);
}
@font-face {
font-family: ChevinBold;
src: url(uploads/fonts/chevibol-webfont.eot);
}
@font-face {
font-family: ChevinExbold;
src: url(uploads/fonts/cheviextbol-webfont.eot);
}

/* Styles */
h1 {
font-family: ChevinLight, Arial, Helvetica, sans-serif;
}
h2 {
font-family: ChevinBold, Arial, Helvetica, sans-serif;
}
p {
font-family: ChevinExbold, Arial, Helvetica, sans-serif;
}

</style>

</head>
<body>

<h1>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus elementum enim ante, nec convallis massa. Cras ac arcu mollis diam laoreet laoreet. Suspendisse leo metus, aliquam nec dapibus a, porttitor id nulla.</h1>
<h2>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus elementum enim ante, nec convallis massa. Cras ac arcu mollis diam laoreet laoreet. Suspendisse leo metus, aliquam nec dapibus a, porttitor id nulla.</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus elementum enim ante, nec convallis massa. Cras ac arcu mollis diam laoreet laoreet. Suspendisse leo metus, aliquam nec dapibus a, porttitor id nulla.</p>

</body>
</html>

Thanks!


Firebug 显示老好人 Foxy 试图加载*.eot版本,看起来很愚蠢,但它只是加载最后一个定义。

你应该用一个包裹 IE 部分有条件评论 http://www.quirksmode.org/css/condcom.html:

<!--[if IE]>
@font-face {
font-family: ChevinLight;
src: url(uploads/fonts/chevilig-webfont.eot);
}
@font-face {
font-family: ChevinBold;
src: url(uploads/fonts/chevibol-webfont.eot);
}
@font-face {
font-family: ChevinExbold;
src: url(uploads/fonts/cheviextbol-webfont.eot);
}
<![endif]-->

另一种方法是将 IE 定义放在顶部。

一些错误:
https://bugzilla.mozilla.org/show_bug.cgi?id=472647 https://bugzilla.mozilla.org/show_bug.cgi?id=472647- 要么忽略.eot,要么支持它
https://bugzilla.mozilla.org/show_bug.cgi?id=520357 https://bugzilla.mozilla.org/show_bug.cgi?id=520357 - "We do not(并且不会)支持 EOT。”[原文如此]

是的,Mozilla 通常会不赞成。

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

@font-face 在 Firefox 中不起作用? 的相关文章

随机推荐

  • 无法使用通过 VS2010 发布在 Windows Azure 上发布网站

    当我尝试通过 Visual Studio 2010 在 Windows Azure 上发布我的 Web 应用程序时 我遇到了这个问题 我尝试右键单击项目并选择发布并导入从 Windows Azure 平台下载的发布配置文件 我收到此错误 错
  • 加入多个文件

    我正在使用标准连接命令来连接两个基于column1 的排序文件 命令很简单 join file1 file2 gt output file 但是如何使用相同的技术连接 3 个或更多文件呢 连接 file1 file2 file3 gt 输出
  • 在运行时根据输入从属性文件中获取值 - java Spring

    我的 color properties 文件为 rose red lily white jasmine pink 我需要获取颜色值 String flower runTimeFlower Value flower String colour
  • Playframework 2.0.x 是否支持模板中的

    不知道play 2 0 3及更高版本是否支持else if在视图中 我只读到必须这样编码 if else if else 不敢相信 我在第二个 if 之前使用了 if true else if true else
  • 使用 nltk 没有上下文的词性标记

    有没有一种简单的方法来确定给定单词最可能的词性标签没有上下文使用nltk 或者如果不使用任何其他工具 数据集 我尝试使用 wordnet 但似乎 sysnet 不是按可能性排序的 gt gt gt wn synsets says Synse
  • Android计算器-Editview无法输入小数位

    我是Android代码开发新手 我正在开发一个Android计算器应用程序 不明白为什么两个EditText 第一个输入和第二个输入 不能接受小数位而只能输入整数 附如下是代码 Thanks 主要活动 package com trial j
  • 将 ScriptableObjects 加载到单个预制件/多个预制件的最佳实践是什么?

    脚本化对象 SO 我最近一直在尝试了解 ScriptableObjects 并在 Unity 中建立了一个项目 我只想射击生成的传入敌人 我已经设置了它 这样我就可以通过 SO s 创建不同的敌人 但注意到我仍然需要为每个敌人创建一个预制件
  • 我们可以简化这个字符串编码代码吗

    是否可以将此代码简化为更干净 更快的形式 StringBuilder builder new StringBuilder var encoding Encoding GetEncoding 936 convert the text into
  • 当有人加入时创建规则协议

    我想要一个机器人将新成员设置为只能查看一个频道并且必须就规则达成一致才能使用服务器的角色 我已经写了这个来做到这一点 但我不断收到此错误 Ignoring exception in on member join Traceback most
  • 仅来自 Sharepoint 列表的自定义字段

    是否可以循环访问共享点列表的字段集合并仅检索我们的自定义字段而不是共享点内置字段 using SPSite site new SPSite http localhost using SPWeb web site OpenWeb SPList
  • 如何实现带进度条的闪屏? - 安卓

    我在启动时有一个闪屏 与以下编码 public class Splash extends Activity Override protected void onCreate Bundle savedInstanceState TODO Au
  • 检查用户是否在 C 中输入字母或数字

    有没有一种简单的方法来调用 C 脚本来查看用户是否输入了英文字母表中的字母 我在想这样的事情 if variable a z printf You entered a letter You must enter a number else
  • Mysql 读锁 SELECT FOR UPDATE

    EDIT I use Node js felixge mysql https github com felixge node mysql pooling connections并有一个poolmysql 连接数 ORIGINAL 我有一个
  • APK 安装失败:[INSTALL_FAILED_VERIFICATION_FAILURE]

    我正在尝试在运行 Jelly Bean 4 2 AOSP 版本的设备上安装 APK 当我 adb install my apk 时 出现错误 安装 失败 验证 失败 我尝试使用 testsign jar 来 签名 apk 但它不会改变结果
  • RegExpValidator 无法正确验证 URL 模式

    The URL http www ftd de rss2 http www ftd de rss2当我在这个 不冒险的 中对照下面的正则表达式检查它时 它是无效的
  • aapt.exe'' 以非零退出值 1 完成

    我有问题 当我运行我的应用程序时写 Error Execution failed for task app processDebugResources gt com android ide common process ProcessExc
  • 如何从命令行启动SVN项目?

    因此 我在本地计算机上创建了一个 Ruby on Rails 应用程序 我有一个我创建的远程存储库 现在我如何第一次签入 我以前从未创建过自己的svn项目 所以我不知道该怎么做 我只对我从事过的项目做出了承诺 解决方案 cd my proj
  • jQuery mouseoverIntent 不起作用,但悬停可以

    我有以下代码 document ready function yearInner hide year this hover function yearInner this slideToggle 它隐藏了带有 YearInner 类的 di
  • 如何删除选取框中的尾随空格?

    我开发了一个不断向上移动的大帐篷 但确切的问题是 在滚动完最后一个图像后 第一个图像和最后一个图像之间存在巨大的差距 我只想删除附加到最后一张图像底部的尾随空格 有没有人帮我找出解决方案 提前致谢 HTML div style margin
  • @font-face 在 Firefox 中不起作用?

    这是由 FontSquirrel 生成的代码 在所有其他浏览器 包括 IE 中都可以正常工作 但在强大的 Firefox 中却不行 我究竟做错了什么 ps 我使用的是FF3 5 如果您无法查看我的示例 请参阅以下来源