gpt4 book ai didi

css - 在哪些操作系统或浏览器上 CSS 字体系列名称区分大小写

转载 作者:技术小花猫 更新时间:2023-10-29 10:36:35 24 4
gpt4 key购买 nike

根据 sitepoint (我通常高度信任的来源)在指定 font-family 名称时某些操作系统/浏览器可能 < strong>区分大小写。

我通常总是使用大小写混合的值,但我想知道小写值是否同样有效?

我对这两种方式都没有压倒性的偏好 - 但我讨厌页面以不同方式呈现,因为我输入了小写的 “v”“V” CSS 文件中的某处。

例如有没有已知的情况下,下面的 2 个带有 foobar 类的 div 实际上会以不同的字体呈现?

div.foo{
font-family:Verdana, Arial, Helvetica;
}

div.bar{
font-family:verdana, arial, helvetica;
}

最佳答案

尽管 CSS syntax overview

The following rules always hold: All CSS style sheets are case-insensitive, 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", of font 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.

css3-fonts module部分要求不区分大小写的比较:

For other family names, the user agent attempts to find the family name among fonts defined via @font-face rules and then among available system fonts, matching names with a case-insensitive comparison.

因此 CSS3 规范要求字体名称不区分大小写。

关于css - 在哪些操作系统或浏览器上 CSS 字体系列名称区分大小写,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1602586/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com