HTML email is different because you do not control the renderer. Inboxes strip, rewrite or ignore code, Outlook has used a different engine from browsers and scripts are blocked, so you build defensively with simple structure, tested CSS and fallbacks, then test the email as it is actually sent.
Web developers arrive at email expecting the same tools and find that most of them do not work. The reason is not that email is behind the times. On the web you write code for a browser, and the browser does what the spec says. In email, the code goes to an inbox that decides what to keep, and often through a sending platform that edits it first. Once you accept that you are a guest in someone else’s renderer, the odd habits of email code start to make sense.
Why can’t you build an email like a web page?
Because the assumptions behind modern web development do not hold. This table sets out the main ones. The right-hand column is our recommended response, not a standard.
| Web assumption | Email reality | Production response |
|---|---|---|
| Modern CSS is widely available | Support varies by client | Use conservative, tested techniques |
| One browser engine | Many inbox rendering engines | Test the clients your audience uses |
| Fonts render consistently | Web-font support varies | Choose robust fallbacks |
| Responsive layout is predictable | Media-query behaviour varies | Design explicit mobile states |
| JavaScript adds behaviour | Scripts are generally blocked | Keep to email-safe patterns |
Who decides which code survives?
Several parties, and none of them is you. The inbox is the first. Google says Gmail supports style blocks and standard CSS, but that it might ignore unsupported CSS properties and selectors. Email on Acid reports something harsher: that Gmail removes the whole style block if it hits something it treats as an error, and that when the Gmail app is used with a non-Gmail account, embedded styles are not rendered at all.
Outlook is the second. Microsoft’s archived documentation for Outlook 2007 says it uses the HTML rendering engine from Word, supports a subset of HTML 4.01 and CSS Level 1, and does not support properties such as float, position, max-width and background images. That page predates today’s versions, and I found no current official Microsoft page for classic Outlook, but a Microsoft community moderator confirms that classic and new Outlook render differently because of their underlying engines. The practical consequence is why email still leans on tables; see why HTML emails use tables.
Your sending platform is the third. Klaviyo’s help centre says it removes scripts and iframes when you save a template, converts unrecognised tags to spans and strips unsupported attributes. That is one vendor, but the lesson holds for any platform: the HTML you wrote is not necessarily the HTML that is sent.
What about JavaScript and interactive email?
Plan on it not running. Klaviyo says most email clients treat scripts as a security threat and block them, and that scripts you add are removed. There is one official route to interactivity. AMP for Email, according to the AMP project, requires sender registration with the supporting clients, authentication with SPF, DKIM and DMARC, and a regular HTML version of the message. The page names Gmail, Mail.ru and Yahoo as supporting clients and does not give a full list or say how the fallback displays. In our view, never put essential content or the main call to action inside anything interactive. Treat it as an enhancement over a complete, ordinary email.
What does a defensive build look like?
These are our working rules, not a specification:
- Tables for structure, because they are the layout method that holds up in the weakest client.
- Critical styles inline, with a small style block for enhancements, so an error cannot take the whole design with it.
- A single-column fallback first, with media queries to enhance it. See our email width and size guide.
- Live text for anything that must be read, with images for what text cannot do. See image-based emails vs live text.
- Font fallbacks you have chosen. Omnisend reports that Gmail does not support @font-face and that only Apple Mail and Outlook for macOS reliably support custom web fonts, so most readers will see a fallback. That is a vendor claim, so check it against your audience.
Which differences are worth fixing?
Decide in advance. Email clients will never render every pixel identically, and chasing parity creates fragile code. In our view, the test is whether the difference changes the message or only the decoration. A background image falling back to a solid colour may be fine. A call-to-action button disappearing, or text becoming unreadable, is not. That gives QA a priority order and stops the team spending an hour on a one-pixel gap while a real defect waits. Separate the two kinds of issue: a known client limitation needs an
Need a hand with this? See our HTML email development service.
Want to make your HTML email production easier to produce?
If your HTML email production keeps getting squeezed between bigger campaigns, we can take the production load off and give your team a setup that is easier to use.