Guides / HTML email best practices
HTML email best practices: design, code and accessibility
Short answer
HTML emails need different rules from web pages: use table-based layouts and inline CSS, keep the width around 600px, give every image alt text, write a preheader, use real text instead of text in images, and test in Gmail, Outlook and Apple Mail before sending.
Layout
Email clients support only part of modern CSS. Classic Outlook for Windows renders email with Microsoft Word's engine, so flexbox and grid don't work there. Table-based layouts with inline styles are the reliable choice, which is why tools like MJML generate them for you.
Content
- Lead with the one thing the reader needs to know.
- Use one primary call to action.
- Keep real text in HTML; text inside images can't be read by screen readers and disappears when images are blocked.
- Write the subject line and preheader together — they're read as one line.
Accessibility
- Alt text on every meaningful image; empty alt (
alt="") on decorative ones. - Colour contrast of at least 4.5:1 for body text.
- Buttons at least 44px tall with descriptive labels (“Track my order”, not “Click here”).
- Set the language attribute and keep a logical heading order.
Dark mode
Some apps invert or adjust colours in dark mode. Avoid pure-black text on transparent backgrounds, give logos a light outline or a version that works on dark, and test both modes.
Testing
Send a test to Gmail, Outlook and Apple Mail on desktop and phone. Check links, merge tags, the unsubscribe link and how the email looks with images turned off.
Frequently asked questions
Why do HTML emails use tables?
Because several email clients — notably classic Outlook for Windows — don't support modern CSS layout. Tables with inline styles display consistently almost everywhere.
Should I put text in images?
No. Text in images can't be read by screen readers, doesn't show when images are blocked and can't be searched. Use live HTML text.
Skip the blank page
5,184 ready-made email templates, edited in your browser and exported for your platform.
Start free