color-background

background-image

Sets one or more background images on an element, including URL images and CSS gradients. Multiple layers stack in the order given, with the first painted on top.

background-image: none | <image> [, <image>]*

Common values

Value Effect
none Removes any background image
url('/img.png') Loads a bitmap or SVG image
linear-gradient(...) Two-stop or multi-stop gradient
radial-gradient(...) Circular or elliptical gradient
conic-gradient(...) Sweep gradient for charts or rings

Examples

.hero { background-image: linear-gradient(180deg, rgb(0 0 0 / .6), transparent), url('/hero.jpg'); }

Overlay gradient on top of a photo

.dot { background-image: radial-gradient(circle at 30% 30%, #fff, #0ea5e9); }

Spherical highlight effect

.chart { background-image: conic-gradient(#22c55e 0 40%, #e5e7eb 0); }

Simple pie-style progress ring

Gotcha

Multiple images stack front-to-back; the first listed layer paints on top of subsequent layers.

Related properties

← All CSS properties · CSS selectors · Grid vs Flexbox