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

属性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"

相关文章:

  • 2022-01-29
  • 2021-09-07
  • 2022-01-25
  • 2022-01-15
  • 2022-12-23
  • 2022-12-23
  • 2022-03-09
猜你喜欢
  • 2022-12-23
  • 2021-12-31
  • 2021-11-02
  • 2021-11-05
相关资源
相似解决方案