Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the CSS colour name: "background"?

background is a valid colour in CSS. It differs per browser; it's a shade of purple in chromium. I can't find any information on it and was wondering why it exists and what it is.

.test {
  height: 200px;
  width: 200px;
  background-color: background;
}
<div class="test"></div>
like image 212
Kalium Avatar asked Mar 23 '17 22:03

Kalium


People also ask

What is background color called in CSS?

The background-color property sets the background color of an element. The background of an element is the total size of the element, including padding and border (but not the margin). Tip: Use a background color and a text color that makes the text easy to read.

What is the background color tag?

Introduction. The attribute that is used to set background color of an HTML element is bg color. Depending on the element whose background color is to be set, we use the appropriate tag. The bgcolor attribute can be used with the following tags- body, table, td, th, tr, marquee.


1 Answers

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

Note that you get the same result with Background, as it's listed in that documentation; CSS is case insensitive, I think they're just listed in CamelCase to make the word boundaries clearer.

.test {
  height: 200px;
  width: 200px;
  background-color: Background;
}
<div class="test"></div>
like image 78
jonrsharpe Avatar answered Sep 29 '22 05:09

jonrsharpe