← Back to properties

CSS Property

background-color

Backgrounds

Sets the background color of an element.

Syntax

background-color: value;

Example

background-color: #111111;

Common use cases

  • Card and section backgrounds
  • Highlight and badge colors
  • Dark mode theming

Practical developer insight

background-color is not inherited — each element needs its own if you want a specific background. Use transparent to let the parent show through.

Related properties