字体系列 "cursive" 在 chrome 移动版 v47 中不起作用

Font family "cursive" doesn't work in chrome mobile v47

我想知道为什么它在 chrome 移动浏览器 v47(最新的 atm)中不起作用,因为它在桌面浏览器上完美运行,包括开发人员工具中的不同移动设备模式。

是否存在解决方法?至少,我能找到下载的原名是什么?

检查一下:

<style>

* {
  font-family: cursive;
}

</style>

<div>
  I should be cursive even on mobile devices
</div>

JSFiddle

注意,它适用于开发者工具,但不适用于真正的移动设备。

切勿依赖通用系列关键字来实际成为“特定字体”。浏览器不需要加载与关键字匹配的字体,从技术上讲它只需要加载“a”字体。 CSS specification 对此非常明确:

"Generic font families are a fallback mechanism, a means of preserving some of the style sheet author's intent in the worst case when none of the specified fonts can be selected. For optimum typographic control, particular named fonts should be used in style sheets.

"All five generic font families are defined to exist in all CSS implementations (they need not necessarily map to five distinct actual fonts)."

我强调了解释您有责任加载正确字体的部分。

我也遇到了这个问题

当您使用 font-family: cursive 时,您实际上是在允许浏览器决定它为 'cursive' 生成的字体系列。

解决方案是特定于您的字体系列,而不是使用通用字体。

serif         eg. Times New Roman, Palatino Linotype, etc.
sans-serif    eg. Arial, Helvetica, Verdana, etc.
cursive       eg. Comic Sans MS, Lucida Handwriting, etc.
fantasy       eg. Impact, etc.
monospace     eg. Courier New, etc.

因此,对于 cursive,您需要指定 Comic Sans MSLucida Handwriting 或您打算实施的其他特定类型。