我在这里浏览了有关此主题的其他帖子,但似乎仍然无法弄清楚。为什么此语法在 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/