CSS Property Reference
A quick reference for all CSS properties and their values. Find what you need to style your web pages.
The `background-color` Property
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).
Example
style.css
body {
background-color: #f0f8ff; /* AliceBlue */
}
h1 {
background-color: rgb(255, 99, 71); /* Tomato */
}
p {
background-color: transparent;
}Property Values
Possible values for the background-color property:
| Value | Description |
|---|---|
| color_name | Specifies a color by its name, like "red" or "blue". |
| hex_code | Specifies a color using a hexadecimal value, like "#ff0000". |
| rgb_value | Specifies a color using RGB values, like "rgb(255, 0, 0)". |
| transparent | Specifies that the background color should be transparent. |