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:

ValueDescription
color_nameSpecifies a color by its name, like "red" or "blue".
hex_codeSpecifies a color using a hexadecimal value, like "#ff0000".
rgb_valueSpecifies a color using RGB values, like "rgb(255, 0, 0)".
transparentSpecifies that the background color should be transparent.