当使用CSS @字体面,以什么顺序做浏览器使用不同类型的? [英] When using CSS @font-face, in what order do browsers use the different types?

查看:283
本文介绍了当使用CSS @字体面,以什么顺序做浏览器使用不同类型的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用 @字体面在CSS中,随时随地记录什么字体类型在每个主要的浏览器的工作,也是重点,他们给不同的字体类型,如果一个或更缺少?我尝试和失败,谷歌的答案。

When using @font-face in CSS is it documented anywhere what font types work in each the major browsers and also the priority they give to different font types if one or more is missing? I tried and failed to Google the answer.

@font-face {
    font-family: 'myfont';
    src: url('myfont.eot');
    src: url('myfont.eot?#iefix') format('embedded-opentype'),
    url('myfont.woff') format('woff'),
    url('myfont.ttf') format('truetype'),
    url('myfont.svg#myfont') format('svg');
    font-weight: normal;
    font-style: normal;
}

希望有一个像类似...

Hoping for a like something like ...

格式:


  • IE10:TTF,EOT,WOFF

  • IE9:EOT,WOFF

  • IE8:...

  • 铬:...

  • 手机浏览器:...

  • 火狐:...

  • Safari浏览器:...

  • 移动Safari浏览器:...

推荐答案

的src 属性的值是一个优先级列表,所以每个浏览器将使用第一个字体中列表是在它支持的格式。从CSS字体模块级别3 CR,部分 4.3字体参考:在src描述符:它的价值是一个外部引用或本地安装的字型名的优先级,逗号分隔的列表。当需要的字体的用户代理,迭代列出引用的集合,使用第一个它可以成功地激活。包含无效数据或找不到本地字体的面孔字体被忽略,用户代理加载列表中的下一个字体。

The value of the src property is a prioritized list, so each browser will use the first font in the list that is in a format it supports. From CSS Fonts Module Level 3 CR, section 4.3 Font reference: the src descriptor: "Its value is a prioritized, comma-separated list of external references or locally-installed font face names. When a font is needed the user agent iterates over the set of references listed, using the first one it can successfully activate. Fonts containing invalid data or local font faces that are not found are ignored and the user agent loads the next font in the list."

这篇关于当使用CSS @字体面,以什么顺序做浏览器使用不同类型的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆