How HTML emails differ from websites
HTML email development looks similar to web development, but the rendering environments are very different. Email clients can remove unsupported markup, restrict CSS properties and block active content. A template that renders correctly in Chrome may look different in a recipient's inbox.
The goal is not to make every email client render every decorative detail identically. Instead, the message should remain readable, understandable and actionable across the environments that matter to your audience.
Start by identifying the purpose of the email. A password reset message requires a different hierarchy from a product newsletter. Define the primary action before adding decorative elements.
Build a reliable email structure
A common starting point is a full-width presentation table containing a centered content table. A maximum width around 600 pixels is a useful convention rather than a mandatory standard.
Use presentation roles on tables that exist only for layout. Actual data tables, such as invoice summaries, should retain their semantic structure.
<table role="presentation" width="100%"
cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="center">
<table role="presentation" width="100%"
style="max-width:600px;">
<tr>
<td style="padding:24px;">
<h1>Welcome to our service</h1>
<p>Your account is ready.</p>
</td>
</tr>
</table>
</td>
</tr>
</table>Apply essential styles inline
Inline CSS keeps essential formatting close to the element it controls. Define text color, font family, line height and important spacing explicitly.
Avoid relying on JavaScript, external stylesheets or complex browser-specific features. Build a readable base template first, then add enhancements where compatibility allows.
Validate before sending
Paste your HTML into MailViewer and inspect the desktop and mobile previews. Review the validation results and investigate any compatibility warnings rather than assuming that every warning represents a rendering failure.
Finish by sending a real test message through your email provider. Verify personalization, links, images, the plain-text alternative and rendering in representative email clients.
Test your HTML email
Use MailViewer to preview, format and validate your HTML email directly in your browser.
Open MailViewer →