Skip to content

PRACTICAL GUIDES

Add an SVG pattern or gradient to a prototype

Choose CSS or a downloaded SVG, check the background at different sizes, and share reproducible settings.

A background can show the intended rhythm of a card, hero or empty state before the final artwork exists. Start with a restrained pattern so you can still judge the content layout. AnyPlaceholder creates dots, grids, stripes and gradients locally; the output contains geometry and colors, without a stock photograph or an image-generation API.

1. Choose a pattern for the test

Start at 1200 × 630 pixels. Change the foreground and background colors, then spacing, weight or angle as applicable. Gradient disables spacing and weight because those settings describe repeating marks. Change one property at a time and inspect the result beside the real heading and button text.

Create an SVG background →

2. Choose CSS or an SVG file

OutputUse it whenCheck
CSSYou want to paste the background declarations into a stylesheet.Keep the generated declarations together. The SVG is embedded in a data URL.
SVGYou want an editable source or a versioned file in your project.Use the downloaded file or SVG source in a tool that accepts SVG.
Settings linkYou want another person to open the same generator settings.This is a link to the editor, not a hosted image URL.

For CSS, create a class in your own stylesheet and paste the copied declarations inside it. Set the element’s dimensions through your layout. If your site blocks data URLs through its content security policy, save the SVG in the project and reference that file instead of weakening the policy.

3. Check narrow, wide and zoomed layouts

Try the background on a narrow card and on a wide banner. Check whether a pattern appears too dense, a gradient’s direction suits the new aspect ratio, or the content becomes difficult to read. The generated SVG has its own dimensions; CSS scaling, cropping or repeating can change the appearance. Inspect the actual destination instead of assuming that the generator preview matches every layout.

4. Keep information outside the decoration

Keep important labels, statuses and instructions as real page content. CSS background images do not provide alternative text to assistive technology. If an image itself conveys information, choose an appropriate content image and text alternative instead. Also inspect text and focus indicators over the lightest and darkest parts of the background.

MDN explains the rendering and accessibility behavior of background-image.

5. Save the artifact, then share the settings

Download the SVG if a screenshot test or design review depends on its exact appearance. A settings link is convenient for iteration, but the generator may change over time. Store the file with your project, record the colors and dimensions, and include the settings link as a way to make a new variation. For foreground layout images, use the separate image placeholder tool.