css - 为什么这个字体速记不起作用?

标签 css google-chrome fonts

我在这里浏览了有关此主题的其他帖子,但似乎仍然无法弄清楚。为什么此语法在 Chrome 中显示为无效并被忽略?

a, a:active, a:visited {
  font: uppercase 400 1.175em "Lato", sans-serif;
}

来自W3 Spec

The 'font' property is, except as described below, a shorthand property for setting 'font-style', 'font-variant', 'font-weight', 'font-size', 'line-height' and 'font-family' at the same place in the style sheet. The syntax of this property is based on a traditional typographical shorthand notation to set multiple properties related to fonts.

我已经尝试了几乎所有我能想到的变体。我尝试将其简化为只有 3 个属性,没有骰子。

这是怎么回事?我很想使用速记并节省一点加载时间,但我开始认为最好完全避免使用它。

更新:问题是“大写”。无法在字体中设置“文本转换”属性:速记。我将“字体变体”与“文本转换”混淆了。

最佳答案

W3C 的引述没有提到 text-transform

从属性中删除大写,语法将有效。

关于css - 为什么这个字体速记不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17681988/

相关文章:

css - 是否有任何替代方法可以将图像定位在不同分辨率的特定位置的页面中

google-chrome - Chrome 上的 SSL 错误

java - 如果缺少 PDF 字体,为什么 jasper 报告不抛出 JRFontNotFoundException?

css - 是否有任何浏览器支持 CSS4 语言/方向选择器? RTL TTB

css - 隐藏页面上的文本但在 window.print 上显示

html - 响应式设计无法使用 chrome 开发工具,但浏览器可以

javascript - 如何从 Chrome console.log() 输出中理解 JS 对象结构?

asp.net - 在 ASP.net 中更改 PasswordStrength 的字体

css - 动态字体大小 Flex 4 可在调整窗口/面板大小时调整大小

html - 导航栏,内联显示问题