属性font-family:Font property font-family does not have generic default

以前定义字体都是用的常用的字体,也没注意过会有这个提示,昨天在写界面的时候重新定义了一个本地没有的字体,发现会有提示。

W3C的文档:

font-family:<family-name>,<generic-family>

  In the example above, the last value is a generic family name.

Style sheet designers are encouraged to offer a generic font family as a last alternative.

属性值需要用逗号分割每个值,并始终提供一个类族名称作为最后的选择。当指定的字体本地没有时,会依次向后匹配,如果指定的值,找不到就会提示。强烈推荐使用一个通用字体系列名作为后路。

有两种类型的字体系列名称:

指定的系列名称:具体字体的名称,比如:"times"、"courier"、"arial"。

通常字体系列名称:比如:"serif"、"sans-serif"、"cursive"、"fantasy"、"monospace"

猜你喜欢

转载自www.cnblogs.com/songForU/p/10529678.html