CSS Waves Background
A wavy line background in pure CSS, built from three radial-gradient rings. Change wave width, line thickness and colors live, then copy the CSS or Tailwind.
.bg-waves {
--bg: #167364;
--fg: #6da89e;
--size: 48px;
--stroke: 4px;
background-color: var(--bg);
background-image:
radial-gradient(circle at 0 0, transparent calc(var(--size) / 2 - var(--stroke) / 2 - 0.5px), var(--fg) calc(var(--size) / 2 - var(--stroke) / 2 + 0.5px) calc(var(--size) / 2 + var(--stroke) / 2 - 0.5px), transparent calc(var(--size) / 2 + var(--stroke) / 2 + 0.5px)),
radial-gradient(circle at 100% 0, transparent calc(var(--size) / 2 - var(--stroke) / 2 - 0.5px), var(--fg) calc(var(--size) / 2 - var(--stroke) / 2 + 0.5px) calc(var(--size) / 2 + var(--stroke) / 2 - 0.5px), transparent calc(var(--size) / 2 + var(--stroke) / 2 + 0.5px)),
radial-gradient(circle at 50% 100%, transparent calc(var(--size) / 2 - var(--stroke) / 2 - 0.5px), var(--fg) calc(var(--size) / 2 - var(--stroke) / 2 + 0.5px) calc(var(--size) / 2 + var(--stroke) / 2 - 0.5px), transparent calc(var(--size) / 2 + var(--stroke) / 2 + 0.5px));
background-size: calc(var(--size) * 2) calc(var(--size) * 1.5);
}<div class="
[--bg:#167364]
[--fg:#6da89e]
[--size:48px]
[--stroke:4px]
[background-color:var(--bg)]
[background-image:radial-gradient(circle_at_0_0,_transparent_calc(var(--size)_/_2_-_var(--stroke)_/_2_-_0.5px),_var(--fg)_calc(var(--size)_/_2_-_var(--stroke)_/_2_+_0.5px)_calc(var(--size)_/_2_+_var(--stroke)_/_2_-_0.5px),_transparent_calc(var(--size)_/_2_+_var(--stroke)_/_2_+_0.5px)),_radial-gradient(circle_at_100%_0,_transparent_calc(var(--size)_/_2_-_var(--stroke)_/_2_-_0.5px),_var(--fg)_calc(var(--size)_/_2_-_var(--stroke)_/_2_+_0.5px)_calc(var(--size)_/_2_+_var(--stroke)_/_2_-_0.5px),_transparent_calc(var(--size)_/_2_+_var(--stroke)_/_2_+_0.5px)),_radial-gradient(circle_at_50%_100%,_transparent_calc(var(--size)_/_2_-_var(--stroke)_/_2_-_0.5px),_var(--fg)_calc(var(--size)_/_2_-_var(--stroke)_/_2_+_0.5px)_calc(var(--size)_/_2_+_var(--stroke)_/_2_-_0.5px),_transparent_calc(var(--size)_/_2_+_var(--stroke)_/_2_+_0.5px))]
[background-size:calc(var(--size)_*_2)_calc(var(--size)_*_1.5)]
"></div><!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Waves — CSS background</title>
<style>
html, body { height: 100%; margin: 0; }
.bg-waves {
--bg: #167364;
--fg: #6da89e;
--size: 48px;
--stroke: 4px;
background-color: var(--bg);
background-image:
radial-gradient(circle at 0 0, transparent calc(var(--size) / 2 - var(--stroke) / 2 - 0.5px), var(--fg) calc(var(--size) / 2 - var(--stroke) / 2 + 0.5px) calc(var(--size) / 2 + var(--stroke) / 2 - 0.5px), transparent calc(var(--size) / 2 + var(--stroke) / 2 + 0.5px)),
radial-gradient(circle at 100% 0, transparent calc(var(--size) / 2 - var(--stroke) / 2 - 0.5px), var(--fg) calc(var(--size) / 2 - var(--stroke) / 2 + 0.5px) calc(var(--size) / 2 + var(--stroke) / 2 - 0.5px), transparent calc(var(--size) / 2 + var(--stroke) / 2 + 0.5px)),
radial-gradient(circle at 50% 100%, transparent calc(var(--size) / 2 - var(--stroke) / 2 - 0.5px), var(--fg) calc(var(--size) / 2 - var(--stroke) / 2 + 0.5px) calc(var(--size) / 2 + var(--stroke) / 2 - 0.5px), transparent calc(var(--size) / 2 + var(--stroke) / 2 + 0.5px));
background-size: calc(var(--size) * 2) calc(var(--size) * 1.5);
}
</style>
</head>
<body class="bg-waves"></body>
</html>Save the pattern as an image, with your current colors and settings.
Waves in other colors
Click a color to try it in the preview above, then copy the code.
Browse by color: Red · Orange · Yellow · Green · Teal · Blue · Purple · Pink
How the waves pattern works
Each wave is built from half circles. A radial-gradient() with two hard stops close together draws a thin ring instead of a filled circle: transparent, then --fg for --stroke pixels, then transparent again.
Each tile holds one full wave, two half circles wide. One ring sits on the bottom edge in the middle, so only its top half shows: the crest. Two more sit on the top corners, so only their bottom halves show: the troughs. The tile edges cut each ring exactly in half, and the halves meet to form one smooth wavy line. Repeating the tile stacks the lines.
--size sets the width of each half wave, and the lines sit one and a half times --size apart, so neighboring waves never touch. --stroke sets the line thickness. Even values for --size keep the curves lined up on whole pixels.
Use waves for beach, travel or ocean themes, playful hero sections, and footers. The Tailwind tab gives the same three rings as arbitrary-property classes for Tailwind v4.