Agent Wranglers

EML-38Recommended

Mark up the message with meaning

Use headings, paragraphs and lists, and mark every layout table with role="presentation", so screen readers announce content and not table cells.

How to do it

Use one h1 for the main subject and h2 for sections. Put lang and dir on the html element and on the main wrapper, because some clients drop the html element. Give every table used only for layout role="presentation". Keep the reading order the same as the visual order. The web version of this rule is Use the right element for the job.

Examples

HTML example

<html lang="en" dir="ltr">
<body>
  <div lang="en" dir="ltr" role="article" aria-roledescription="email" aria-label="Your order has shipped">
    <table role="presentation" width="100%" cellpadding="0" cellspacing="0">
      <tr><td>
        <h1>Your order has shipped</h1>
        <p>Order 1042 left our warehouse today.</p>
      </td></tr>
    </table>
  </div>
</body>
</html>

How to check

Open the test send with a screen reader such as VoiceOver or NVDA. It reads headings as headings and never says "table" or "row" for layout.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/email/layout-and-accessibility/semantic-structure">Agent Wranglers email playbook</a>. In code you write, add a comment next to it with the same link.