TL;DR
linear-gradient(), radial-gradient(), conic-gradient() (plus their repeating- variants), and of course - any image.background-color paints behind all images. Control paint boxes with background-clip and background-origin.position/size/repeat/blend-mode).Why this matters: layered CSS backgrounds let you ship rich visuals with no images, faster LCP, and crisp scaling on any DPI. Done right, it’s great for SEO and performance: fewer image downloads, smaller payloads, and easier iteration.
Backgrounds accept a comma‑separated list. The first item is the topmost layer, the last is the bottommost. background-color (if set) is below all layers.
background-image:
linear-gradient(to bottom, #f33 0%, #00f0 70%), /* layer 1 */
linear-gradient(to top left, #0f0 0%, #00f0 70%), /* layer 2 */
linear-gradient(to top right, #00f 0%, #00f0 70%); /* layer 3 */
Paint boxes and coordinates are controlled separately:
background-origin: which box positions the background (border/padding/content)background-clip: which box clips paint (border/padding/content/text)background-position/background-size: per‑layer placement and scaleEach of these can be provided as comma‑separated lists aligned with your layers (covered deeply in Part 2 CSS Background Layers: Position, Size, Repeat, Attachment, and Blend‑Mode).
linear-gradient(angle, stops...)radial-gradient(size at position, stops...)conic-gradient(from angle at position, stops...)repeating-linear-gradient(...), repeating-radial-gradient(...), repeating-conic-gradient(...)You can freely combine them in a single background-image list.
Preview box (pure CSS, no images):
background-color to maintain consistency.background-image:
radial-gradient(86% 76% at 84% 2.5%, #7C4DFF 0% 34%, transparent 100%),
radial-gradient(73% 88% at -4% 60%, #26C6DA 0% 33%, transparent 100%),
radial-gradient(86% 38% at 7.5% 79%, #00ACC1 0% 22%, transparent 100%),
radial-gradient(63% 39% at 31% 14%, #26C6DA 0% 22%, transparent 100%),
linear-gradient(101deg, #7C4DFF 0%, 61.8%, transparent 100%);
The positioning and clipping boxes matter for precise effects like “inside‑padding only” textures or sharp borders.
/* Three layers: texture, highlight, base */
background-image:
radial-gradient(12px at 12px 12px, red, 50%, transparent 60%),
linear-gradient(180deg, #00ceaf9e, #00ceaf2e 40%),
linear-gradient(180deg, #ffffff60, #3d63ff6e);
background-origin picks the box used for position/size coordinates.background-clip defines where paint can appear (here we keep the upper layers away from the border)./* Position inside content for top two, allow base to paint under border */
background-origin: content-box, content-box, border-box;
background-clip: content-box, content-box, border-box;
padding: 24px;
border: 8px solid var(--ui-border-accented);
border-radius: 8px;
soft-light, multiply, or overlay for tasteful depth.position/size/repeat/blend-mode) and how lists align.