gpt4 book ai didi

css - 如何替换颜色 : windowtext;

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

我正在使用旧的 CSS 样式表,其中一些条目类似于:

.calibre18 {
color: windowtext;
font-family: "Book Antiqua", "serif";
font-size: 1.29167em;
line-height: 1.2;
}

这在 color: windowtext; 上不断出错我发现它已被弃用“支持 CSS3 UI appearance 属性”。不幸的是,这似乎也被弃用了。

如何重现作者的初衷?

最佳答案

旧的 CSS2 系统颜色名称已被弃用,原因如下:

These color names have been deprecated, however, as they are insufficient for their original purpose (making website elements look like their native OS counterparts), and represent a security risk, as it makes it easier for a webpage to "spoof" a native OS dialog.

http://dev.w3.org/csswg/css-color-4/#system-colors

另一条相关引述:

User agents must support these keywords, but should map them to "default" values, not based on the user’s OS settings (for example, mapping all the "background" colors to white and "foreground" colors to black). Authors must not use these keywords.

恕我直言,您不应尝试重现作者的初衷,也不应依赖用户代理的默认支持,而应定义实际颜色。

关于css - 如何替换颜色 : windowtext;,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28511649/

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