color-background

background

Shorthand for all background-* properties, letting you set color, image, position, size, and repeat in one declaration. Resets any background properties you do not specify to their initial values.

background: <color> || <image> || <position> / <size> || <repeat> || <origin> || <clip> || <attachment>

Common values

Value Effect
transparent No background color
#fff Solid white background
linear-gradient(...) Gradient as an image layer
url(...) center/cover no-repeat Image sized to cover, centered, no tiling
none Removes background image, keeps color

Examples

.hero { background: url('/hero.jpg') center/cover no-repeat; }

Full-bleed hero image

.card { background: #fff; }

Solid white card surface

.btn { background: linear-gradient(135deg, #4f46e5, #7c3aed); }

Diagonal gradient button

Gotcha

The shorthand resets background-color and background-image; use longhand when layering multiple backgrounds.

Related properties

← All CSS properties · CSS selectors · Grid vs Flexbox