CSS“颜色"与“字体颜色" [英] CSS "color" vs. "font-color"
问题描述
任何人都知道CSS为什么为文本提供color
却没有font-color
或text-color
吗?
Anyone know why CSS provides color
for text, but does not have font-color
or text-color
?
似乎很违反直觉,有点像text-decoration: underline
而不是font-style
或与字体有关的东西.
Seems very counter-intuitive, kind of like text-decoration: underline
rather than font-style
or something related to fonts.
有人知道W3C为什么/如何提出这么多CSS名称吗?
Does anyone know why/how the W3C came up with such a wide array of CSS names like this?
推荐答案
我认为原因之一可能是该颜色应用于除字体之外的其他内容.例如:
I would think that one reason could be that the color is applied to things other than font. For example:
div {
border: 1px solid;
color: red;
}
同时产生红色字体颜色和红色边框.
Yields both a red font color and a red border.
或者,就像其他地方所证明的那样,W3C的CSS标准可能完全是落后和荒谬的.
Alternatively, it could just be that the W3C's CSS standards are completely backwards and nonsensical as evidenced elsewhere.
这篇关于CSS“颜色"与“字体颜色"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!