Resources

What email HTML teaches frontend developers: tables, inline CSS, and client quirks

What email HTML teaches frontend developers: tables, inline CSS, and client quirks

Email HTML teaches frontend developers to build for a renderer they do not control. Nested tables, inline styles and fixed pixel widths look like leftovers from 2005, but they exist because one message may pass through Gmail, classic Outlook, new Outlook, Apple Mail, mobile apps, security filters and dark mode before anyone reads it. Working under that constraint trains habits that carry straight back into web work: defensive styling, real progressive enhancement and testing what reaches the user.

Even a small piece such as the output of an email signature maker shows the problem. It has uncertain CSS support, image fallbacks, client-specific rendering and a layout that has to stay readable after parts of the styling disappear.

Why is email HTML like a frozen browser?

Developer writing HTML and CSS in a code editor on a laptop

Because email has no universal engine. A browser target is fairly predictable: Chrome, Safari, Firefox and Edge do not render everything identically, but modern standards give them a strong shared baseline. Email clients do not share one.

Classic Outlook for Windows still uses a Word-based engine to render HTML email, while new Outlook uses a more modern web-based approach. The same message can look different in two applications that carry almost the same product name. Gmail supports inline styles, <style> blocks, selectors and media queries, but only within its supported CSS set, and unsupported properties or selectors may simply be ignored. Apple Mail is generally more forgiving.

The result is not a broken web platform. It is several partial web platforms stacked behind one format. That changes the question you ask. Instead of “is this valid CSS?” you ask “what happens when the weakest important renderer does not understand it?” That habit is useful far beyond email, for example when you check frontend mistakes that break dashboards on browsers and devices you did not build on.

A practical way to apply it is a small support matrix for the features you rely on: flexbox, CSS Grid, <style> blocks, media queries, web fonts and CSS background images. Rate each one as good support, partial, limited or avoid relying on it, rather than trying to document every client version.

Why do email layouts still use tables?

Table translating web layout techniques such as flexbox and gap into their email equivalents

Tables are one of the few structures that old and modern rendering engines understand consistently. On the web, a two-column profile card is a few lines of markup plus a flex rule:

<div class="profile">
  <img src="avatar.jpg" alt="Jane Doe">
  <div class="details">...</div>
</div>

.profile {
  display: flex;
  align-items: center;
  gap: 16px;
}

That is clean and easy to maintain, but it gets risky when classic Outlook is part of the audience. The safer email version uses a presentation table:

<table role="presentation" width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td width="80">
      <img src="avatar.jpg" width="64" alt="Jane Doe">
    </td>
    <td>
      Name and contact details
    </td>
  </tr>
</table>

This forces a different kind of layout thinking. Instead of trusting flex behavior you think in explicit columns. Instead of gap you use cell padding. Instead of letting content decide every width, you define the important ones. Nested tables are not elegant, but they make the dependency tree visible, and they prompt useful questions. If this cell collapses, what moves with it? If this image disappears, does the text still make sense? If one renderer ignores a style, does the structure survive?

Why does inline CSS matter in email?

Inline CSS keeps the rules that matter attached to the element that needs them. A frontend codebase normally benefits from shared stylesheets, inheritance and a predictable cascade. Email pushes critical styles much closer to the element:

<td style="font-family: Arial, sans-serif;
           font-size: 16px;
           line-height: 24px;
           color: #222222;">
  Hello world
</td>

An inline CSS email looks repetitive, but the repetition is the point. The presentation rule travels with the element, so there are fewer assumptions between markup and rendering. This does not mean <style> blocks are unsupported. Gmail handles many normal rules and media queries. But other clients, editors and forwarding workflows can alter what survives, so developers inline anything essential.

Frontend developers already know cousins of this idea. CSS-in-JS moves styling closer to the component, utility classes make visual decisions explicit in markup, and component-scoped styles limit the number of external rules a component depends on. Email takes the principle to an extreme: if a rule is essential, make it hard for the rendering pipeline to lose it.

How does email teach progressive enhancement?

Frontend developer coding on two monitors, one showing a file manager and the other showing code

It makes the principle unavoidable. Start with the version that has to work everywhere, then add features for clients that support them. Build the fallback first and treat everything else as an enhancement.

  • Web fonts: a branded font may look great in Apple Mail and fail elsewhere. Define a safe fallback, such as font-family: "Brand Font", Arial, sans-serif;, and make sure the design still works when Arial appears.
  • Background images: if an image is essential to understanding the content, it should probably not exist only as a CSS background.
  • Dark mode: some clients preserve colors, others adjust or invert parts of the message. A design that depends on one exact background-and-text pair can fail even when every line of HTML is intact.
  • Media queries: they can improve mobile presentation, but the base layout should be usable without them. The same thinking applies to responsive design on the web.

How do you test email HTML properly?

Checklist for testing HTML email across clients, devices, dark mode, blocked images, replies and forwards

You test several rendering environments instead of one implementation at several viewport sizes. A web developer can open DevTools, resize the viewport and reproduce most bugs locally. A template that looks right in Chrome proves very little about classic Outlook. The workflow in the image above works well: build the simplest reliable version, send a real message, check the clients your audience uses, test desktop and mobile, check light and dark mode, block images, and test replies and forwards when the component will sit inside ongoing conversations.

Notice that every step starts from user-visible behavior, not code validity. Frontend testing is ultimately about what reaches the user, not what the source code was supposed to do.

If you are still deciding what kind of message you are building, the difference between transactional and marketing email also changes how much layout complexity you can afford.

What does email HTML teach about accessibility?

It exposes shortcuts quickly. If images are blocked and the content becomes meaningless, the HTML depended too much on images. If a screen reader treats a layout table as tabular data, the markup needs help.

  • Put role="presentation" on layout tables.
  • Give images that carry information useful alt text, and use empty alt attributes for decorative ones.
  • Keep text as real text instead of baking it into an image.
  • Write links that explain their destination without relying on the surrounding visual context.
  • Include a plain-text version for environments where HTML is unavailable or disabled.

None of this is unique to email. Email just gives you fewer places to hide when it is missing.

Why is an email signature a good practice project?

A signature is a small laboratory. A full newsletter can have dozens of modules, responsive rules, images and special cases. A signature may hold only a name and job title, a logo or profile image, a phone number, a website link and a few social icons, yet it still has to survive Outlook, Gmail, Apple Mail, forwarding, mobile screens, image blocking and dark mode.

Build one with a two-column layout, explicit image dimensions, inline styles and alt text, then test it across clients. Next, deliberately remove some of the styling and ask whether the information still works. That exercise teaches more about defensive rendering than a perfect screenshot does.

How do you reuse tested email patterns?

Keep a library of snippets that survived your target clients, and stop rebuilding them. Good candidates are outer containers, two-column layouts, buttons, images, spacing and typography. Reusable snippets become a primitive component library: the implementation uses tables and inline styles, but the engineering idea is the one modern frontend teams use, solve the compatibility problem once, document it and reuse the known-good version.

A team can build these patterns internally or use tooling such as Stripo.email in the production workflow. Either way, the valuable asset is not the editor. It is the set of tested patterns you know will hold up in your clients.

Frequently asked questions

Should frontend developers learn email HTML?

If your product sends email, yes. Even a few hours of work teaches defensive layout, fallbacks and testing in real clients, and those habits transfer to web projects.

Can I use flexbox or CSS Grid in email?

Support is partial and depends on the client. If classic Outlook is in your audience, a presentation table is the safer base, and flex or grid can only be an enhancement on top.

Are style blocks safe in email?

Gmail supports them within its CSS set, but other clients, editors and forwarding steps may strip or change them. Inline the essential rules and use style blocks for enhancements such as media queries.

Why does my email look right in the browser and broken in Outlook?

A browser preview uses a modern engine, while classic Outlook renders with a Word-based one. Always test in the real client rather than trusting the preview.

What is the main lesson from email HTML?

Constraints are the lesson. Tables teach structural layout, inline CSS moves critical rules next to the content they style, client differences make progressive enhancement a requirement, and testing shows that your development environment is not the user’s rendering environment. To try it, build a two-column signature with inline styles this week, send it to three clients and see what breaks.

Bogdan Sandu

Stay sharp. Ship better code.

Every week: one curated article, one tool worth knowing, one tip you can use tomorrow. No noise, no padding.