Image Handling in Email Clients
Handle blocked images with alt text and background colors.
Image Handling in Email Clients is a free HTML Academy lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the HTML Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Images are Often Blocked
Many clients block images by default until the user clicks "show images". Outlook, Gmail (for unknown senders) and most mobile clients on a metered connection display a placeholder instead. Design assuming images may not appear.
Use Real Text, Not Images of Text
Never bake critical copy (headings, CTA labels, prices) into images. Use HTML text styled with inline CSS so the message lands even when images are blocked, screen readers can read it, and dark-mode inverts adjust it appropriately.
Always Include Alt Text
Every <img> needs a descriptive alt attribute. When images are blocked, alt text appears in the placeholder box — well-written alt fills the visual void with the message that would have been conveyed by the image.
<img src="https://cdn.example.com/logo.png" alt="Coddy" width="120" height="40" style="display:block;border:0">Set width and height Explicitly
Without explicit dimensions the placeholder collapses and layout shifts when the image loads. Set both attributes (and corresponding inline style) so the cell reserves space whether or not the image ever arrives.
display: block on Images
Outlook inserts a small gap below inline images. Apply style="display:block" on every <img> to eliminate that gap and ensure consistent vertical rhythm across all clients.
border: 0 on Linked Images
Older clients add a blue border around <a><img></a>. Set border="0" on the image attribute and style="border:0" inline so wrapped images render cleanly inside calls to action.
Absolute URLs Only
Email clients have no concept of "this page". Every image src must be an absolute https:// URL pointing to a publicly accessible CDN. Local paths, relative paths and http:// URLs (mixed content) silently fail to load.
Host on a CDN
Use a fast, geographically distributed image host. Some clients fetch images via proxies (Gmail) which add their own caching layer; first-party CDNs avoid hot-loading from a slow origin and ensure images load consistently across regions.
Background Image Fallbacks
For hero backgrounds, pair the CSS background-image with a bgcolor matching the dominant tone. If the image is blocked, the cell still shows a sensible color, and text overlaid on the bgcolor remains legible — avoiding the white-text-on-white-block disaster.
Retina Images
Render images at 2x and downscale via width attribute so they look sharp on high-DPI displays: a 600x600 source displayed at width="300" height="300" appears crisp on Retina. The cost is bandwidth, so keep file sizes small with WebP-equivalent compression.
Animated GIFs
Animated GIFs work in most clients except Outlook (which shows only the first frame). Design the first frame so it makes sense as a static image — the headline, CTA, or key value must be readable even without the rest of the animation.
Knowledge Check
Why should critical copy (headings, CTA labels, prices) never be baked into images in an HTML email?
Summary
Treat images as enhancement, not the message. Use absolute https URLs, set width/height/display:block/border:0, write meaningful alt text, host on a fast CDN, pair backgrounds with bgcolor fallbacks, design 2x for Retina, and remember Outlook freezes GIFs on the first frame.
Frequently asked questions
Is the “Image Handling in Email Clients” lesson free?
Yes — the full text of “Image Handling in Email Clients” is free to read here on the web, and the HTML Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the HTML Academy course, upgrade to CoddyKit PRO.
What will I learn in “Image Handling in Email Clients”?
Handle blocked images with alt text and background colors. You practise HTML Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start HTML Academy?
No prior experience is required. HTML Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Image Handling in Email Clients” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this HTML Academy lesson?
Yes. Every HTML Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- The Table-Based Layout Approach
- Inline Styles for Email
- Image Handling in Email Clients
- Testing with Litmus and Email on Acid