CSS "color" vs. "font-color"

Css

Css Problem Overview


Anyone know why CSS provides color for text, but does not have font-color or text-color?

Seems very counter-intuitive, kind of like text-decoration: underline rather than font-style or something related to fonts.

Does anyone know why/how the W3C came up with such a wide array of CSS names like this?

Css Solutions


Solution 1 - Css

The same way Boston came up with its street plan. They followed the cow paths already there, and built houses where the streets weren't, and after a while it was too much trouble to change.

Solution 2 - Css

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.

Alternatively, it could just be that the W3C's CSS standards are completely backwards and nonsensical as evidenced elsewhere.

Solution 3 - Css

I know this is an old post but as MisterZimbu stated, the color property is defining the values of other properties, as the border-color and, with CSS3, of currentColor.

currentColor is very handy if you want to use the font color for other elements (as the background or custom checkboxes and radios of inner elements for example).

Example:

.element {
  color: green;
  background: red;
  display: block;
  width: 200px;
  height: 200px;
  padding: 0;
  margin: 0;
}

.innerElement1 {
  border: solid 10px;
  display: inline-block;
  width: 60px;
  height: 100px;
  margin: 10px;
}

.innerElement2 {
  background: currentColor;
  display: inline-block;
  width: 60px;
  height: 100px;
  margin: 10px;
}

<div class="element">
  <div class="innerElement1"></div>
  <div class="innerElement2"></div>
</div>

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionFred WilsonView Question on Stackoverflow
Solution 1 - CssRobustoView Answer on Stackoverflow
Solution 2 - CssMisterZimbuView Answer on Stackoverflow
Solution 3 - CssquasiView Answer on Stackoverflow