我正在使用指南针模块从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');
}
注意格式(“eot”)和格式(“embedded-opentype”)的不同。
据我所知,这是为IE8及以下浏览器添加的。但如果使用两个不同的格式标签(在windows / linux中),它会不会产生任何问题。
答案 0 :(得分:0)
我已经看到使用了两个值,但我无法找到任何记录的差异。
Microsoft @font-face documentation说(强调我的):
要指定特定的字体格式(仅适用于外部引用的字体文件),请使用格式提示(format(fontFormat)),其中fontFormat是以逗号分隔的格式字符串列表,表示支持的字体格式。 可能的fontFormat值是" woff"," truetype"," opentype"," embedded-opentype"。从Internet Explorer 9开始,格式提示是可选的。(Internet Explorer 8及更早版本不支持格式提示,但会被忽略。)
由于.eot文件格式仅适用于Microsoft浏览器,因此在这种情况下,我会接受他们的话,并使用format('embedded-opentype')
。