Sub topic 13
Accessibility basics for email
This chapter assumes you know basic HTML and CSS, and that you have already built a table-based layout with inline styles. Accessibility in email means people who use screen readers, magnification, or high-contrast settings can read and act on your message. Email clients give you less control than browsers do, so a few habits matter more.
Declare the language
Screen readers pick a pronunciation engine from the lang attribute. Without it, a reader may pronounce your English text with the wrong voice. Set it on the html element, as the layout example in this tutorial does:
<html lang="en">If a section is in another language, put lang on the element that wraps it. Always include a meaningful <title>, because some clients and assistive tools announce it.
Mark layout tables as presentation
Tables are your layout tool, but a screen reader may announce them as data: "table with 2 columns, 3 rows." Add role="presentation" to every layout table so the reader skips that talk and reads the content in order.
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="padding:24px;font-family:Arial,Helvetica,sans-serif;font-size:16px;line-height:24px;color:#222222;">
<h1 style="margin:0 0 12px;font-size:24px;line-height:30px;">Your order has shipped</h1>
<p style="margin:0;">It should arrive on Friday.</p>
</td>
</tr>
</table>Use a real data table, without role="presentation", only for tabular data such as an order summary. Give its header cells <th>.
Keep reading order logical
Screen readers follow source order, not visual order. When columns stack on a phone, the left column comes first. Write the HTML in the order you want it read, and avoid tricks that reorder content visually.
Use real headings (h1 to h3) and paragraphs. Style them inline, as above, so the structure survives and the look stays under your control.
Write useful alt text
Every img needs an alt attribute, and clients that block images show the alt text in place of the picture.
- Informative image: describe its purpose, such as
alt="Red running shoes, 30% off". - Decorative image, such as a divider: use an empty
alt=""so readers skip it. - Image of text: repeat the text in
alt, and prefer live text when you can.
Never leave alt out. A missing attribute can make a reader announce the file name.
Contrast, size, and links
Aim for a contrast ratio of at least 4.5:1 for body text and 3:1 for large text, following WCAG (the Web Content Accessibility Guidelines). Light gray text on white fails this test, and it looks worse on a phone in sunlight. Check dark mode colors as well as light ones.
Do not use color alone to carry meaning. A red price and a green price need a label or symbol too.
Write link text that makes sense out of context. "View your order" works. "Click here" does not, because screen reader users often list all links on their own. Keep the underline on inline links so they stand out without relying on color. The button from the previous chapter already uses descriptive text and a large tap area.
Check your work
| Practice | Why it helps |
|---|---|
| `lang` on `html` | Correct pronunciation |
| `role="presentation"` on layout tables | No "table" announcements |
| Alt text on every image | Meaning survives blocked images |
| 4.5:1 contrast | Readable on small, dim screens |
| Descriptive link text | Usable link lists |
Exercise
A template uses a two-column layout table with no role attribute, a decorative divider image with no alt, and a link that reads "Click here". Name the fix for each problem.
Show answer
Add role="presentation" to the layout table so it is not announced as data. Add alt="" to the divider so readers skip it. Change the link text to describe the destination, such as "View your order".