CSS PATTERN GENERATOR
Build a repeating background pattern from pure CSS gradients, then copy the CSS.
.pattern {
background-color: #201d19;
background-image: radial-gradient(#4a4238 1.5px, transparent 1.5px);
background-size: 24px 24px;
}How to build a CSS background pattern
- 1
Choose a pattern type: Dots, Grid, Stripes, Checkerboard, or Diagonal.
- 2
Adjust the scale to make the pattern larger or smaller.
- 3
For Stripes and Diagonal, drag the angle knob to rotate the lines.
- 4
Pick the background and pattern colors.
- 5
Copy the generated CSS background rule.
Questions
- Do these patterns use any images?
- No — every pattern here is built entirely from CSS gradients (radial-gradient and linear-gradient) tiled with background-size, so there's no image file to load, no extra HTTP request, and the pattern scales crisply at any zoom level or screen density.
- How does the dot pattern work with just a gradient?
- A `radial-gradient(color 1.5px, transparent 1.5px)` draws one small solid circle fading to transparent right at its edge. Setting `background-size` to a value larger than the dot tiles that single dot across the whole element at a regular interval, creating the dot-grid look.
- Why does the checkerboard pattern need four gradients and a background-position offset?
- Two diagonal gradients form the light and dark triangles of one tile, and the position offset shifts alternating copies of that tile so the triangles fit together into full squares that alternate color — a well-known pure-CSS technique for checkerboards without any image.
- Can I use these patterns as a subtle background behind text?
- Yes — keep the pattern color close in value to the background color (e.g. a background of #201d19 with a pattern color of #2a2521) so the texture reads as subtle rather than distracting, especially with dots or a diagonal pattern.
- Does this tool send my design anywhere?
- No — everything runs locally in your browser. The CSS is generated in real time and nothing is uploaded to a server.