For most patterns, use a CSS repeating gradient: it needs no image file, scales with the element, and lets you control stripe, dot, or wedge spacing with color-stop positions. If you already have an authored pattern image, set it as a background and tune background-repeat, background-size, and background-position. Keep the pattern decorative, retain a fallback color, and check that text stays legible.
Make a pattern with a repeating gradient
CSS gradients are images, so you can assign one to background-image just as you would a file. A repeating gradient repeats its color-stop sequence to fill the background area. That makes it a practical first choice for simple stripes, dots, rings, and angular designs: the browser draws the pattern, and there is no separate raster asset to fetch.
Here is a complete example you can paste into an HTML file and open in a browser. The panel has a fallback color, a diagonal stripe pattern, and content over it:
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>CSS pattern example</title>
<style>
.patterned-panel {
padding: 2rem;
color: #222;
background-color: #f7f7f7;
background-image: repeating-linear-gradient(
45deg,
#f7f7f7 0 10px,
#e2e2e2 10px 20px
);
}
</style>
<section class="patterned-panel">
<h1>Patterned panel</h1>
<p>The pattern is decoration; this text carries the content.</p>
</section>
</html>
The angle controls the stripe direction. The intervals set the colors and their boundaries: the first color covers 0–10 pixels, and the second covers 10–20 pixels. Because the adjacent stops meet at 10 pixels, the change is crisp. The sequence spans 20 pixels before it repeats. Increase or decrease those positions to change the band widths and repeat interval.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
#1 Best Overall
- EASY TO USE: Our wall stencil is incredibly easy to use, even for those who have never used a stencil before. Simply apply the stencil to your desired surface, and paint over it with your favorite colors
- HIGH QUALITY MATERIAL: Our wall stencils are made from recyclable Dupont Mylar high quality stencil material. They are resistant to oil, fat, dilute acid, dilute alkali, and most solvents. They are also washable and reusable
- BUDGET FRIENDLY: Bring your home to life for just a small fraction of the cost in comparison to wallpaper. Use our stencils for wall decoration to save on renovation costs
- PACKAGE CONTENTS: Includes six 14.2 inch width by 11.5 inch height sheets of wall stencils. Packaged in a zip lock bag for easy and tidy storage
- UNIQUE DESIGN: Our wall stencil features a modern design that can be used in any room of your home. Whether you want to create a fun accent wall in your room, or add a cool touch to your wood or furniture, our stencil works well for the job
A plain linear-gradient() makes one gradient transition; repeating-linear-gradient() continues its stop sequence. The same general idea applies to repeating radial and conic gradients, but their geometry differs.
Choose the gradient shape for the pattern
Stripes with repeating-linear-gradient()
Use this for parallel bands. The first argument is the direction or angle; following arguments define color stops. For vertical bands, use an angle or direction that runs across the element rather than diagonally. Keep paired boundaries at the same position when you want a hard edge. If you want a soft transition, use stops that occupy different positions instead of making their edges meet.
Dots or rings with repeating-radial-gradient()
Radial gradients spread outward from a center. A repeating radial gradient can create rings, or a dot-like motif when small colored circles are separated by a transparent or background-colored area. For example:
Rank #2
- 【Versatile Stencils】These premium stencils are designed for painting, crafts, and home decor projects. Ideal for various surfaces, including walls, wood, fabric, and more.
- 【Beautiful Flower Designs】Get creative with our collection of flower stencils, featuring intricate and detailed designs that add elegance and charm to your artwork.
- 【Easy to Use and Reusable】Made from durable and flexible material, these stencils are easy to use and can be reused multiple times. Simply position the stencil, paint, and lift to reveal stunning results. Whether you're painting walls, decorating furniture, or adding patterns to fabric, these stencils ensure consistent and precise results.
- 【Perfect for Home Decoration】Enhance your living space with these large stencils for painting on walls. Create a personalized and stylish ambiance that reflects your unique taste.
- 【Suitable for Crafts】Contains 9 flower stencils, size: length 20cm/7.87inch, width 15cm/5.91inch, Whether you're a DIY enthusiast or a professional artist, these stencils are perfect for various craft projects, including scrapbooking, card making, and more.
.dot-pattern {
background-color: #fff;
background-image: repeating-radial-gradient(
circle,
#777 0 2px,
transparent 2px 12px
);
}
Here each repeated sequence begins with a small, solid circle and continues with a transparent interval. Since the transparent portion reveals the element’s underlying background color, set that color explicitly. Adjust the stop distances to change the dot size and spacing.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsAngular motifs with repeating-conic-gradient()
Conic gradients distribute color around a center by angle. Repeating conic gradients are useful for wedges and angular, checker-like motifs. As with other gradients, the stop positions determine where the color changes and how the sequence repeats. Because visual results depend on the element’s shape and size, preview the pattern at the actual component dimensions rather than only in a small code sample.
Use an image tile when you need a specific texture
If you already have a hand-drawn motif, photographic texture, or other authored tile, use a URL background instead of rebuilding it with gradient stops:
Rank #3
- You will get: the package comes with sufficient quantity of reusable tile stencils, each one is about 12 x 12 inches, and approx. 0.25 mm/ 0.1 inch thick, suitable for home painting decoration
- Quality material: these wall templates are made of PET material, stable and hard, high toughness, not easy to break or deform, and smooth and compact on surfaces, bring you a satisfying experience
- Wide application: these tile pattern stencils are ideal supplies for creating art decors, which can decorate your floors, walls, cabinets and other places in your home, and you can also apply these tile pattern stencils for painting practice and making art works
- Reusable for you: our drawing templates can be applied many times, which are easy to clean, reusable and flexible, each one can serve you for a long time, which also brings you much convenience; It is recommended to wash it with detergent before the first use
- Nice gifts: you can give some reusable stencils to your sister, lover, friends or classmates who like drawing or DIY handicrafts on Valentine's Day, birthdays, weddings, parties, anniversaries and more
.patterned-panel {
background-color: #f7f7f7;
background-image: url("/images/pattern.png");
background-repeat: repeat;
background-size: 24px 24px;
}
The URL is relative to the site’s CSS or document context, depending on where the CSS is written. Change background-size to scale the tile, background-position to shift its starting point, and background-repeat to control whether it tiles. The displayed tile size can differ from the image’s original pixel dimensions, so check the result in context.
Gradients and image tiles solve slightly different problems. Gradients avoid a separate image asset and resize with the element; a tile is useful when the pattern depends on a precise authored texture or motif. Both can be layered. In a comma-separated background-image list, the first listed image is the top layer:
.layered-panel {
background-color: #f7f7f7;
background-image:
repeating-linear-gradient(45deg, transparent 0 8px, #ddd 8px 9px),
url("/images/paper-texture.png");
background-repeat: repeat, repeat;
background-size: auto, 160px 160px;
}
Each comma-separated layer can have its own repeat, size, or position value, in the same order as the images. Layering gives you flexibility, but it also makes it harder to identify which layer caused an unexpected color or scale. Start with one layer, confirm it, and add another only when the design needs it.
Rank #4
- LARGE WALL STENCIL: Include 1pc tree stencil, 11.8x11.8 inch/30x30cm. Large size meets your more needs
- WIDE APPLICATION: Using these reusable templates, you can paint on walls, wood, canvas, furniture, floors, etc., and can even be used as pattern fills for photo frames and replace wall decorations
- EASY TO USE: Made of eco-friendly translucent plastic, it can be folded properly, can be washed, with rounded edges, and can be used for a long time
- WALL DECOR: The most popular bird patterns, used to create a vibrant atmosphere for your home. Perfect for painting craft, journal, notebook, diary, scrapbook, diy, airbrush or decorating rooms
- PRECISION CUTTING: Each template is cut with precision instruments, the pattern is complete and clear, without burrs, and the cutting surface is smooth
Set a fallback and preserve readable content
Use background-color along with a background image. If the image does not load, or an environment does not render the image as expected, the color remains behind the content. Choose a fallback that keeps foreground text readable; do not assume the pattern will always be visible.
Background images are not announced by screen readers. Treat a pattern as decorative. If it communicates meaning—such as status, category, or an instruction—put that information in semantic document content as well, rather than relying on the background alone.
Check contrast where text actually appears, including the lightest, darkest, and busiest parts of the pattern. MDN presents WCAG contrast thresholds of 4.5:1 for body text and 3:1 for large text. A pattern that looks subtle behind a heading can still make smaller text difficult to read. If the pattern interferes with legibility, simplify it, move it away from text, or use a more suitable foreground/background color combination.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Best Value
- EASY TO USE: Our wall stencil is incredibly easy to use, even for those who have never used a stencil before. Simply apply the stencil to your desired surface, and paint over it with your favorite colors!
- UNIQUE DESIGN: Our wall stencil features a modern design that can be used in any room of your home. Whether you want to create a fun accent wall in your room, or add a cool touch to your wood, furniture, our stencil is perfect for the job.
- HIGH QUALITY MATERIAL - Our wall stencils are made from durable and recyclable Dupont Mylar high quality stencil material.They are resistant to oil, fat, dilute acid, dilute alkali, and most solvents. They are also non-toxic, tasteless, durable, washable and reusable
- BUDGET FRIENDLY: Bring your home to life for just a small fraction of the cost in comparison to brand new tile. Use our stencils for Wall to save big time on renovation cost.
- PACKAGE INCLUDES: TWO 11.2 inch (W) x 11.2 inch (H) sheets Stencils, Packed Securely , Arrived in a Very solid Beautiful Cardboard Envelope That Has a Snap to Secure Stencils And Keeps Stencils from Bending.
Debug common pattern problems
- The element has no visible pattern: Check that the CSS selector matches the element and that the element has an area to paint. Confirm the
background-imagedeclaration is not overridden by a later rule. For a URL tile, inspect the path and make sure the asset loads; for a gradient, check the commas and parentheses in the stop list. - Stripes are too wide or uneven: Review each stop position. The repeating interval is determined by the distance through the stop sequence, while the individual intervals determine how much space each color occupies. Set adjoining stop positions equal for crisp edges.
- A tile is too large, tiny, or misaligned: Adjust
background-sizeandbackground-position. Checkbackground-repeattoo: a tile set tono-repeatwill not fill the area. - A layered background hides another layer: Remember that the first image in the comma-separated list is on top. Check the layer order and whether the upper layer uses transparency. Keep values for repeat, size, and position in matching list order.
- Text is hard to read: Increase the contrast, reduce visual complexity, or keep the pattern out of the text area. The pattern is optional decoration; the content must remain understandable without it.
Browser support and practical checks
MDN labels repeating-linear-gradient() and repeating-radial-gradient() Baseline Widely available and reports availability across browsers since July 2015. That is a suitable basis for ordinary current web development, but it is not a guarantee for every obsolete browser or unusual embedded webview. If your project has a specific legacy-browser requirement, check the compatibility information for that browser before relying on a particular function.
Before shipping, check the pattern at the component’s normal and narrow widths, where text may wrap and occupy different parts of the background. Test with the background image disabled or unavailable to verify that the fallback remains acceptable, and inspect text contrast at the places where content will sit.
Or skip the browser setup
After you have added the CSS and deployed a page, a screenshot can help you inspect how the pattern looks in the rendered site. It does not create or change the CSS; the stylesheet still controls the pattern. ScreenshotNeo is a website screenshot API and MCP server from ScreenshotNeo. One GET request captures a URL as an image or PDF. For example, this cURL request saves a screenshot:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo documentation for API options. Before capture, it accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each of those steps can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers identify the page verdict and whether the shot was billed. Its MCP server offers take_screenshot, get_page_info, and capture_pdf for AI agents and MCP clients. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Sign up for free and get 1,000 screenshots a month with no card.
Recommended Free Tools
Frequently Asked Questions
Does a CSS background pattern change the size of the element?
No. A background paints behind an element’s content; it does not add content or determine the element’s layout dimensions. Use padding, width, or other layout rules to size the element.
Can I make the same pattern appear on several parts of a page?
Yes. Put the background declarations in a reusable CSS class and apply that class to each element that should share the pattern.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

