What is CSS color name: background?

background- valid color in CSS. It is different for each browser; it's a shade of purple in chrome. I can not find any information about this and wondered why it exists and what it is.

.test {
  height: 200px;
  width: 200px;
  background-color: background;
}
<div class="test"></div>
Run codeHide result
+6
source share
1 answer

It refers to one of the CSS2 system colors , is now deprecated .

Please note that you get the same result Backgroundas it is indicated in this documentation; CSS is case insensitive, I think they are simply listed in CamelCaseto make word boundaries clearer.

.test {
  height: 200px;
  width: 200px;
  background-color: Background;
}
<div class="test"></div>
Run codeHide result
+4
source

Source: https://habr.com/ru/post/1015981/


All Articles