Keep critical formatting inline
Email clients do not all process stylesheets and CSS selectors in the same way. Essential formatting should not depend entirely on a complex stylesheet.
Apply font families, text colors, line heights and important spacing directly to the relevant elements. A build-time CSS inliner can help maintain a cleaner source template.
<p style="font-family:Arial,sans-serif;
font-size:16px;line-height:24px;
color:#334155;margin:0 0 16px;">
Your email content goes here.
</p>Choose predictable layout techniques
Flexbox, Grid and advanced positioning are convenient for websites, but support varies across email clients. Use simpler structures when broad compatibility is a priority.
For important spacing, table-cell padding can be a practical alternative to margins that may behave inconsistently. Avoid unnecessary nested tables that make templates difficult to maintain.
Design graceful fallbacks
A rounded button should still be recognizable if border radius is ignored. Text over a background image should remain readable when the image is unavailable.
Separate essential information from visual decoration. This makes it easier to identify which CSS features require additional compatibility work.
Maintain consistent design tokens
Define a small set of approved colors, spacing values and font sizes in your source project. Resolve these values into the final email HTML during template generation.
Preview the final generated HTML rather than only the original template. This helps detect styling problems introduced by the build process or the email delivery provider.
Test your HTML email
Use MailViewer to preview, format and validate your HTML email directly in your browser.
Open MailViewer →