A hero background pattern is a small tileable graphic, usually 200–400 px per side, repeated with CSS background-repeat and scaled with background-size to fill a large header. Keep the heading legible by choosing low-contrast motifs or adding an overlay so text meets at least 4.5:1 contrast, and test seams in a 2×2 grid.
What a hero background pattern is
A seamless hero background pattern is the repeating image behind the headline and opening copy of a landing section. It is related to, but more specific than, seamless background patterns: the tile must hold its structure while a heading sits on top of it. A useful tile is a square or near-square graphic, usually 200–400 px on each side, that carries one clear motif. The term seamless does not mean identical shapes; it means the left edge continues the right edge and the top continues the bottom, so the repeat disappears.
- Tile: the single repeated image.
- Motif: the visible shapes inside the tile, such as leaves, lines, dots, or color fields.
- Negative space: the quiet area between motifs that lets the heading sit without fighting for attention.
- Seamless: the tile edges match so the repeat reads as one continuous surface.
Why a small tile scales to a large hero
A 240 px tile fills a 1920 px wide header because CSS repeats background images along both axes. The background-repeat property controls that behavior. The three CSS background repeat tile values worth knowing are repeat, space, and round.
repeatis the default. The image tiles as many times as needed and clips the last tiles if the space does not divide evenly.spacepins the first and last tiles to the edges and distributes even gaps between them, so no tile is clipped.roundstretches each tile slightly until another whole tile fits; this preserves complete motifs but can distort the aspect ratio.
MDN Web Docs describes the edge behavior. Pair the repeat value with background-size to reproduce the tile at the pixel size you designed, and the same small asset works under a wide header. MDN gives a concrete case: a 100 × 100 px tile in a 1099 × 750 px area repeats 10 times horizontally and 7 times vertically with round, and each copy stretches to 109.9 × 105 px, changing the aspect ratio. That distortion is why round suits loose textures more than measured geometry.
Motif selection for hero backgrounds: contrast at a glance
Owen Jones, The Grammar of Ornament (1856), classified ornament by the way lines and shapes repeat, not by geography alone. That grammar still helps choose a hero motif because the repeat structure determines how busy the background becomes.
| Motif | Origin | Contrast risk | Text overlay | Scale |
|---|---|---|---|---|
| Damask | Damascus silk; two-tone mirrored leaf and flower forms | Low: large soft shapes in close values | Plain overlay or none if the ground is close in value to the text | Large repeat, 300–400 px |
| Floral | 19th-century wallpaper repeat; block printing favored soft irregular motifs | Medium: varied leaves and blooms create busy edges | Light scrim or darker text on a light ground | 240–360 px |
| Geometric | Grid-based ornament, including the classified examples in Jones | High: repeating lines and corners pull the eye | Strong overlay or low-value ground under the heading | 160–240 px |
| Abstract | 20th-century textile and screen-based pattern, often soft fields of dots or gradients | Variable by value; low-value abstract fields are safest | Tune the overlay to the measured contrast | 200–300 px |
Sort motifs by value before style. The column that matters most is light-dark difference, because color value and hue affect legibility more than subject matter. The safest hero pattern keeps its lightest and darkest parts close to the ground, so the heading keeps its edge. For most hero sections, a geometric pattern needs the lowest detail and the most testing; an abstract or damask field carries a heading with less adjustment. The choice is not between ornate and plain but between a ground that stays quiet and one that competes.
Keeping the heading legible: contrast and overlays
Text over a pattern fails when the pattern and the heading have similar light-dark values. The W3C WAI sets the minimum contrast at 4.5:1 for normal text and 3:1 for large text, defined as 18 point or 14 point bold. Hue matters less than light-dark difference; a red heading over a green ground can still fail if the two reflect similar luminance. The thresholds are not rounded: a computed 4.499:1 does not meet the 4.5:1 criterion.
For a pattern background with text overlay, the overlay is the control that flattens the value range.
- Choose a motif whose value range stays near the ground.
- Add a semi-transparent overlay of the ground color, then measure the computed ratio.
- Read the pattern as a background; the heading only needs contrast against the darkest visible part.
- If the heading is large enough to qualify for the 3:1 threshold, still test the smaller supporting text below it.
This is the same value contrast judgment painters make when they light a figure against a dark ground. The overlay can be applied as a separate background layer, but the contrast check remains the same: measure the rendered foreground against the rendered darkest point behind it.
Build a seamless SVG pattern with CSS, step by step
A small SVG <pattern> keeps the tile in one file and lets CSS repeat it at any size.
- Draw a square tile at a fixed size, such as 240 × 240 px, and keep every shape inside the edges.
- Define an SVG
<pattern>withwidth="240"andheight="240"and setpatternUnits="userSpaceOnUse"so the repeat size stays fixed. The MDN SVG Patterns tutorial walks through the coordinate choices. ThepatternUnitschoice matters:userSpaceOnUsekeeps a fixed pixel repeat, whileobjectBoundingBoxscales the pattern with the element and can leave large empty areas if the motif does not scale. For a hero tile, fixed pixels are usually easier to control. - Test the tile by placing four copies in a 2×2 grid at 100 %. Fix edge discontinuities in value, not just motif, before export.
- Set the CSS
background-sizeto the same pixel size, such as240px 240px, and setbackground-repeat: repeat. - Preview the header at full width and re-check the edge columns where the repeat meets the element edge.
<svg width="0" height="0" xmlns="http://www.w3.org/2000/svg">
<defs>
<pattern id="heroTile" width="240" height="240" patternUnits="userSpaceOnUse">
<rect width="240" height="240" fill="#f2efe9"/>
<circle cx="120" cy="120" r="42" fill="none" stroke="#8a7f70" stroke-width="6"/>
</pattern>
</defs>
</svg>Then apply it in CSS:
.hero {
background-image: url("heroTile.svg");
background-repeat: repeat;
background-size: 240px 240px;
}If a circle shifts into an ellipse on the last repeat, the edge is not seamless; correct the tile rather than stretching the asset in CSS.
Pattern grammar from damask to Owen Jones
A damask pattern is a two-tone, mirror-symmetrical motif of stylized leaves and flowers; the name comes from Damascus silk, and the structure still works on a web page because the repeat is large and the contrast is low. Owen Jones, The Grammar of Ornament (1856), grouped ornament by repeat logic, not by region alone. That classification connects a 19th-century wall-covering repeat to the CSS background-repeat system: both rely on a unit, a repeat, and a ground. William Morris later used flat, all-over floral fields that behave like quiet hero grounds. For the longer arc, follow pattern history across movements. A hero tile does not need a named historical motif, but borrowing its grammar—large scale, low value contrast, even distribution—shortens the testing process.
FAQ
What is a hero background pattern? A small seamless hero background pattern repeated with CSS background-repeat and scaled with background-size to fill the header behind the heading.
What size should a seamless pattern tile be? 200–400 px per side works well; larger motif repeats need more seam care and heavier files.
How do you make a pattern repeat seamlessly? Place four copies in a 2×2 grid and fix edge discontinuities in value, not just motif, before export.
How do you keep text readable over a patterned background? Add a semi-transparent overlay or low-contrast ground so the heading meets at least 4.5:1 contrast.
Sources
W3C WAI, “Understanding SC 1.4.3: Contrast (Minimum)”; MDN Web Docs, “background-repeat”; MDN Web Docs, “SVG Patterns”; Owen Jones, The Grammar of Ornament (1856).

Keep reading