CSS Mesh Gradient
A mesh gradient in pure CSS, made from stacked radial gradients since CSS has no native mesh. Pick all five colors and the softness, then copy CSS or Tailwind.
.bg-mesh-gradient {
--bg: #880088;
--c1: #cc3f47;
--c2: #de6f3d;
--c3: #f09f33;
--c4: #aa2068;
--spread: 55%;
background-color: var(--bg);
background-image:
radial-gradient(at 15% 20%, var(--c1) 0, transparent var(--spread)),
radial-gradient(at 85% 10%, var(--c2) 0, transparent var(--spread)),
radial-gradient(at 75% 85%, var(--c3) 0, transparent var(--spread)),
radial-gradient(at 10% 90%, var(--c4) 0, transparent var(--spread));
}<div class="
[--bg:#880088]
[--c1:#cc3f47]
[--c2:#de6f3d]
[--c3:#f09f33]
[--c4:#aa2068]
[--spread:55%]
[background-color:var(--bg)]
[background-image:radial-gradient(at_15%_20%,_var(--c1)_0,_transparent_var(--spread)),_radial-gradient(at_85%_10%,_var(--c2)_0,_transparent_var(--spread)),_radial-gradient(at_75%_85%,_var(--c3)_0,_transparent_var(--spread)),_radial-gradient(at_10%_90%,_var(--c4)_0,_transparent_var(--spread))]
"></div><!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Mesh Gradient — CSS background</title>
<style>
html, body { height: 100%; margin: 0; }
.bg-mesh-gradient {
--bg: #880088;
--c1: #cc3f47;
--c2: #de6f3d;
--c3: #f09f33;
--c4: #aa2068;
--spread: 55%;
background-color: var(--bg);
background-image:
radial-gradient(at 15% 20%, var(--c1) 0, transparent var(--spread)),
radial-gradient(at 85% 10%, var(--c2) 0, transparent var(--spread)),
radial-gradient(at 75% 85%, var(--c3) 0, transparent var(--spread)),
radial-gradient(at 10% 90%, var(--c4) 0, transparent var(--spread));
}
</style>
</head>
<body class="bg-mesh-gradient"></body>
</html>Save the pattern as an image, with your current colors and settings.
How this mesh gradient works
CSS has no real mesh gradient, so the usual approach is to fake one with several radial-gradient() layers. Each layer puts a soft blob of color at a different spot (at 15% 20%, at 85% 10% and so on) and fades it to transparent by --spread. Where the blobs overlap, they blend into each other like a mesh, and the base color --bg fills the gaps between them.
The default blend runs through neighboring colors: red, orange and yellow glowing over a purple base, like a sunset. Neighboring colors blend cleanly. Colors from opposite sides of the color wheel tend to turn muddy where they meet.
--spread controls softness. Lower values give distinct glowing spots, higher values a smooth wash of color. A mesh gradient doesn’t tile, so it fills any size of element.
Use it for hero sections, app landing pages, pricing cards and soft section backgrounds. To move a blob, edit its at x% y% position. The Tailwind tab outputs the same layers for Tailwind v4.