css - 格式 ('embedded-opentype' ) 和格式 ('eot' 之间的区别)

标签 css sass compass-sass

我正在使用 compass 模块从 sccs 文件生成我的 css 文件。

早些时候我只在 Linux 上工作,当创建 css 文件时,fon-face 属性如下所示:

@font-face {
    font-family:"NationalReg";
    src: url('../fonts/national-regular.eot');
    src: url('../fonts/national-regular.eot?#iefix') format('eot'), url('../fonts/telecomnational-regular.woff') format('woff'), url('../fonts/national-regular.ttf') format('truetype'), url('../fonts/national-regular.svg') format('svg');
}

现在我在 Windows 上工作,生成的 css 文件具有以下结构:
@font-face {
    font-family:"NationalReg";
    src: url('../fonts/national-regular.eot');
    src: url('../fonts/national-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/telecomnational-regular.woff') format('woff'), url('../fonts/national-regular.ttf') format('truetype'), url('../fonts/national-regular.svg') format('svg');
}

注意 format("eot") 和 format("embedded-opentype") 的区别。

我知道这是为 IE8 及以下浏览器添加的。但是如果使用两种不同的格式标签(在 windows/linux 中),它会产生任何问题。

最佳答案

我已经看到使用了这两个值,但我找不到任何记录在案的差异。

Microsoft @font-face documentation说(强调我的):

To specify specific font formats (only for externally referenced font files), use a format hint (format(fontFormat)) where fontFormat is a comma-separated list of format strings that denote supported font formats. Possible fontFormat values are "woff", "truetype", "opentype", and "embedded-opentype". The format hint is optional starting in Internet Explorer 9. (format hints are not supported in Internet Explorer 8 and earlier versions and are ignored.)



由于 .eot 文件格式仅适用于 Microsoft 浏览器,在这种情况下,我会相信他们的话并使用 format('embedded-opentype') .

关于css - 格式 ('embedded-opentype' ) 和格式 ('eot' 之间的区别),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24601534/

相关文章:

float 内容的CSS问题

php - 在 CodeIgniter 中编辑表单

javascript - 全屏背景上的热点,背景位置为 : center

sass - 编译SCSS时我收到一条错误消息,其中指出}

css - SASS 在多行上缩进语法?

ruby-on-rails - 静态设置 : error with Compass integration

html - css checkbox hack 是如何工作的?

css - Sencha 构建 - app.scss 崩溃

css - 制作基于 sass (scss) 的网格 - 如何使用一个声明创建类名列表

css - IE 特定过滤器(如 -ms-filter)的 Sass Mixin 错误