DevTools Logo
All posts

Placeholders Without a Service: SVG, Data URIs, and CSS Backgrounds

November 19, 2026 · DevTools

svg
placeholder
css
design

Placeholder images usually come from a service: a URL like placehold.it/640x360 that renders the image on someone else's server and adds a third-party request (and dependency) to your page. The SVG Placeholder Generator takes the other route — the placeholder is generated on your device, exported as markup, and inlined into your project. No external request, no service to outlive your prototype.

One SVG, four exports

Set width and height (clamped to a 1–4096 px budget), pick background and label colors, type a label, add corner radius — and the markup builds as you type. Four formats share the same generated SVG:

  • Raw <svg> code — for direct inclusion in HTML, JSX, or templates.
  • URL-encoded data URI — for anywhere a URL works, including email templates where external images are often blocked.
  • <img> snippet — ready to paste, with width, height, and alt already filled in.
  • CSS background-image rule — a 256×256 avatar placeholder drops into a stylesheet with zero extra requests.

A small character count keeps data-URI weight honest, because an inline placeholder that costs more than the image it's standing in for is not a win.

The details that make it usable

  • Auto-fitting label — the font size shrinks until the text fits 90% of the canvas, so long labels don't overflow a small placeholder.
  • XML-escaped labels — pasted markup can't break the template; the label is text, always.
  • Contrast feedback — a label color too close to the background triggers a ratio warning against the 3:1 large-text bar before the placeholder ships, not after someone squints at it.
  • Live preview — the preview renders the exact same data URI you copy, so what you saw is what you shipped.

Where this beats a placeholder service

Prototypes that must work offline or behind firewalls, email templates where external images may not load, test suites that assert on stable markup, and production build steps where a third-party placeholder domain is an unacceptable dependency. An OG-banner mock at 1200×630 pastes into a prototype as an <img> snippet in seconds, before the real artwork exists.

Everything is computed on the device — no uploads, no service calls, no generated-image watermark. When the placeholder graduates to real artwork, clean up the hand-made SVG with the SVG Optimizer, and for the human-shaped gaps, the Dummy Avatar Generator fills profile slots instead.