About this tool
These patterns are made only of CSS gradients, so they scale perfectly, cost no extra downloads and are easy to recolor. Choose from dots, polka, grids, graph paper, stripes, checkerboard, zigzag and more. Set the colors, tile size and line weight, then copy the background properties.
How to use CSS Pattern Generator
- Choose a pattern.
- Pick the pattern and background colors.
- Set the tile size and line or dot size.
- Copy the CSS.
Frequently asked questions
Why use CSS instead of an image?
A CSS pattern weighs a few hundred bytes, stays sharp on any screen and can change color with a variable, for example in dark mode.
Can I use transparent colors?
Yes. Any CSS color works, including transparent ones, so the pattern can sit over an image or gradient.