首先CSS2.1 font这一章没有提及font-family的大小写问题,只提到它的值要么作为标志符出现、要么作为string出现。Font family names must either be given quoted as strings, or unquoted as a sequence of one or more identifiers. This means most punctuation characters and digits at the start of each token must be escaped in unquoted font family names.
在CSS2.1里定义的字体匹配算法里也没有提到。
我们专门找到string格式定义的这一章:
All CSS syntax is case-insensitive within the ASCII range (i.e., [a-z] and [A-Z] are equivalent),except for parts that are not under the control of CSS. For example, the case-sensitivity of values of the HTML attributes "id" and "class", offont names, and of URIs lies outside the scope of this specification. Note in particular that element names are case-insensitive in HTML, but case-sensitive in XML.
原来找了这么半天已经超出CSS的定义范围了吗。
不,其实CSS3的字体匹配算法里已经重新定义了字体匹配过程:
Case sensitivity of font family names
As part of the font matching algorithm outlined below, user agents must match font family names used in style rules with actual fon