HTML Academy · Lesson

Image Handling in Email Clients

Handle blocked images with alt text and background colors.

Lesson 3 of 413 steps

Image Handling in Email Clients is a free HTML Academy lesson on CoddyKit. This is lesson 3 of 4. Any 3 lessons of this learning path are free to read in full — after that, CoddyKit PRO unlocks every lesson, plus hands-on practice with a built-in code editor and a 24/7 AI tutor. It is part of the HTML Academy learning path, and your progress syncs across the web and the CoddyKit app. The HTML Academy course includes 4 lessons in total.

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.

Free to start

Learn HTML with an AI tutor — free

Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.

Courses
40
Lessons
159

Frequently Asked Questions

Is the “Image Handling in Email Clients” lesson free?

Yes — any 3 lessons of the HTML Academy learning path, including “Image Handling in Email Clients”, are free to read in full here on the web. After that, CoddyKit PRO unlocks every lesson, plus interactive practice with a built-in code editor and a 24/7 AI tutor. The HTML Academy course includes 4 lessons in total.

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, so you can start here or from the beginning and move at your own pace. This is lesson 3 of 4.

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

  1. The Table-Based Layout Approach
  2. Inline Styles for Email
  3. Image Handling in Email Clients
  4. Testing with Litmus and Email on Acid
← Back to HTML Academy