The color of the background is defined with the property simply called background-color.
As other color related properties (i.e. color) color may be described in few possible ways; that is as one of 16 pre-defined names, as RGB decimal numbers or a "hash (#)" delimited hexadecimal numbers.
The background-color property contains following information:
- value: <color>, transparent or inherit;
- initial: transparent;
- applies to: all elements;
- inherited: no;
- percentages: N/A;
- media: visual;
- computed value: as specified.
The value color sets a color of an element. If the value is not explicitly assigned or it is set as transparent the element's color will be the same as its parent (due the transparency effect).
Learn more about the color data type!
CSS background-color property example: