September 19, 2026
|
7 min read
|
72 views

Universal Prompts: Create Graphic Design with AI (HTML/CSS → Image)

Reusable prompt templates for generating designs via HTML/CSS rendered to image (flyers, changelog cards, badges, print docs, blog images, slides)

Universal Prompts: Create Graphic Design with AI (HTML/CSS → Image)

This is the workflow behind the "best graphic design with AI" method: instead of asking an image model to paint a design (which usually looks generic), you ask Claude to code the design in HTML/CSS, then render that HTML to a pixel-perfect PNG/JPEG. This gives you real typography, real alignment, and infinite precise edits.

Prerequisite: for Claude to render HTML into a downloadable PNG itself, turn on Code execution and file creation first — Settings > Capabilities in claude.ai (or Settings > Capabilities on mobile). Without it, Claude can still write the HTML as an artifact you can preview in-browser, but you'd need to screenshot it yourself rather than getting a real high-resolution image file.

How it works (the core loop)

  1. Fill in your Brand System block once (below) and keep it saved somewhere — paste it into every prompt.

  2. Pick the template that matches what you're making and fill in the brackets.

  3. Send it to Claude. It writes a self-contained HTML file and renders it to a crisp, high-resolution image.

  4. Review the image, ask for specific fixes, get a re-render.

  5. You get the final image plus the HTML source, so it stays editable later.


Your Brand System (fill in once, reuse everywhere)

Brand: [name]
Colors: background [hex], primary accent [hex], secondary accent [hex], text [hex]
Fonts: display/headline [font name], body [font name], labels/mono [font name]
Logo: [describe it or attach the file — note if it must never sit in a box/container]
Voice/style rules: [e.g. no em dashes in visible text, direct tone, no corporate buzzwords]
Visual style: [e.g. dark canvas with glow / light gradient / minimal / 3D floating shapes]

Paste this block into any template below wherever it says "Brand system: [use my Brand System block]."


1. Social Media Flyer (any purpose)

Use for: announcements, tips/educational posts, quotes, testimonials, event promos, weekly recurring series — any single-image social post.

Design a [dimensions, e.g. 1080x1080] social media graphic in HTML/CSS.

Purpose: [e.g. announce something / share a tip / highlight a testimonial / promote an event / quote card]
Headline: [big word or short phrase]
Supporting copy: [1-2 short lines max]
Call to action (if any): [e.g. link, tagline — leave blank if this is a pure content/quote post]

Brand system: [use my Brand System block]

Rules:
- Keep text elements visually left-aligned (or centered — specify)
- Avoid decorative shapes overlapping or sitting behind body text
- Build as a single self-contained HTML file with fonts embedded

Then render it to PNG at 4x device scale factor so the output is crisp at full resolution. Show me the image before finalizing so I can request pixel-level tweaks.

2. Changelog / Feature Update Card

Use for: "What's New" release notes, product update graphics, feature grids.

Design a changelog graphic in HTML/CSS announcing [version number / month] updates.

Features to include (as a grid of cards, [N] items):
1. [Feature name] - [NEW/IMPROVED] - [one-line description]
2. [Feature name] - [NEW/IMPROVED] - [one-line description]
[...]

Layout: [e.g. 2x3 grid of feature cards]
Brand system: [use my Brand System block]
Footer: prominent CTA bar linking to [URL], visually distinct from a regular flyer so the two don't get confused in a feed

Build as self-contained HTML, then render to PNG at 4x scale. Show me the result before finalizing.

3. ID / Badge / Pass Card (bulk, print-ready)

Use for: event passes, name badges, membership cards — especially when generating many at once from a CSV/list.

Design a [size, e.g. A5 portrait] badge/pass card in HTML/CSS for [event/organization name].

Card tiers: [e.g. White = Participant, Blue = Facilitator, Black = Committee]
Fields per card: Full Name, [Skill Track / Role / Department], Reference Code
Header: [logo placement, org name]
Footer: [event name + dates]

Requirements:
- Design must work as a template with placeholder fields I can swap per person
- I have a CSV with [N] rows containing [columns] — generate one card per row
- Embed fonts directly in the HTML rather than relying on system fonts

Render each card at exact pixel dimensions matching print size (e.g. 2236x3176px for ~384 DPI A5), then package everything into a zip.

4. Print Document (Brochure, Certificate, Thank-You Card)

Use for: multi-page brochures, certificates, formal thank-you cards with decorative borders.

Design a [document type, e.g. certificate / A5 thank-you card / brochure page] in HTML/CSS for [organization/event name].

Content:
- [Recipient name field / body copy / list of sections]
- [Any QR code, seal, or watermark — describe placement]

Style: [e.g. cream background, navy border, gold corner flourishes, circular watermark seal — formal/certificate style]
Dimensions: [exact size + DPI, e.g. A5 at 300 DPI = 1748x2480px]

Build as self-contained HTML with embedded fonts and any logo/seal images as base64. Render to PNG at the exact target dimensions, then convert to print-optimized JPEG if needed.

5. Blog Featured Image

Use for: the header/cover image at the top of a blog post — wide format, minimal text, meant to be seen small in a feed or list view.

Design a [dimensions, e.g. 1920x1080] blog featured image in HTML/CSS for a post titled "[title]".

Concept: [describe the visual metaphor or focal graphic, e.g. glossy hero orb with halo, dashboard mockup, abstract data viz, icon-based illustration]
Text on image: [headline only, or none at all — this is a cover image, not a slide with paragraphs]
Brand system: [use my Brand System block]

It needs to read clearly at thumbnail size (as it'll show small in a blog list), so keep any text large and the composition simple.

Build as self-contained HTML, render to PNG at 2x device scale factor (use 4x instead if this will also be used in print).

6. Presentation Slide Graphic

Use for: a single polished slide — title slide, section divider, or a data/concept visual for a deck.

Design a [dimensions, e.g. 1920x1080] presentation slide in HTML/CSS.

Slide type: [title slide / section divider / data visual / concept diagram]
Content: [headline, subhead, key data points, or diagram elements]
Brand system: [use my Brand System block]

Build as self-contained HTML, render to PNG at 2x device scale factor.

7. Pixel-Perfect Iteration Prompt (use after any of the above)

This is the prompt that actually makes the output look designed instead of AI-generic — use it repeatedly after the first render.

Here's the current render: [attach PNG]

Issues to fix:
1. [e.g. the headline isn't visually left-aligned — check for font side-bearing offset]
2. [e.g. the strikethrough price looks misaligned - probably a nested font-size/position issue]
3. [e.g. remove the green circle behind the card, it's competing with the text]

Verify the fix by measuring the rendered image rather than eyeballing it, then re-render and show me again.

Notes from what's worked well before

  • Always embed fonts directly in the HTML rather than relying on live font links — avoids render-time failures and font-swap flashes.

  • Ask for the HTML file alongside the PNG. Files don't persist between chat sessions, so keeping the HTML lets you re-render later without rebuilding from scratch.

  • Fill in the Brand System block once and reuse it across every prompt in a series — this is what keeps a whole month/series of graphics looking consistent instead of each one drifting.

Published with Braandly