The HTML Email Boilerplate

Share this article

Web developers often moan about having to support five mainstream browsers, a few mobile devices and quirky behavior in a certain applications. If you think we have it bad, spare a thought for those creating HTML emails. They must contend with:

Forget about stylesheets, floats, negative margins, positioning, background images, animated GIFs, PNGs or any other fun time-saving techniques. If you think it’s tough making a site work in IE6 today, HTML emails must be coded like it’s 1998. That means tables, inline styles and images. Fortunately, Sean Powell has taken inspiration from Paul Irish’s HTML5 Boilerplate and created the HTML Email Boilerplate. It includes various fixes discovered by industry leaders such as Campaign Monitor and MailChimp
to produce a bullet-proof email template which works in Outlook, GMail, Hotmail, Yahoo Mail and other popular clients. Sean admits it’s not plug and play — you will need to get your hands dirty with coding — but it’s a great first step which solves many of the common problems experienced when developing HTML emails. The HTML Email Boilerplate code includes two HTML files: one with commented instructions and one without which can be used as the basis of your email. It’s issued under the MIT License, is free and can be used for any commercial or non-commercial project. What have you got to lose? Please let us know if you’ve tried the boilerplate and, more importantly, whether it worked in your email application.

Frequently Asked Questions (FAQs) about HTML Email Boilerplate

What is the significance of the HTML Email Boilerplate?

The HTML Email Boilerplate is a crucial tool for web developers and designers. It provides a solid foundation for creating HTML emails, ensuring they render correctly across various email clients. It includes essential CSS resets and definitions that help overcome the inconsistencies and quirks in email clients’ rendering engines. It also includes helpful comments and tips to guide you through the process of customizing your email template.

How does HTML Email Boilerplate differ from regular HTML?

While regular HTML is used for creating web pages, HTML Email Boilerplate is specifically designed for creating emails. It includes specific CSS resets and definitions to handle the inconsistencies in how different email clients render HTML emails. It also includes media query support for responsive design, ensuring your emails look great on any device.

Why is there a need for CSS resets in HTML Email Boilerplate?

CSS resets in HTML Email Boilerplate are necessary to ensure a consistent look across all email clients. Different email clients have different default styles, which can cause your emails to look different in each client. CSS resets help to override these default styles, providing a consistent base for your email design.

How can I make my HTML Email Boilerplate responsive?

HTML Email Boilerplate includes media query support, which allows you to create responsive designs. By using media queries, you can specify different styles for different screen sizes, ensuring your emails look great on any device. You can also use fluid layouts and flexible images to further enhance the responsiveness of your emails.

Can I customize the HTML Email Boilerplate?

Yes, the HTML Email Boilerplate is fully customizable. It includes helpful comments and tips to guide you through the process of customizing your email template. You can add your own styles, change the layout, and modify the content to suit your needs.

Why is my HTML Email not displaying correctly in some email clients?

This could be due to the inconsistencies in how different email clients render HTML emails. The HTML Email Boilerplate includes CSS resets and definitions to handle these inconsistencies, but some email clients may still display your emails differently. To ensure your emails display correctly, it’s important to test them in various email clients before sending.

How can I test my HTML Email Boilerplate?

There are several online tools available for testing HTML emails, such as Litmus and Email on Acid. These tools allow you to preview your emails in various email clients and devices, helping you identify and fix any issues before sending.

Can I use HTML Email Boilerplate for commercial projects?

Yes, the HTML Email Boilerplate is open-source and free to use for both personal and commercial projects. However, it’s always a good idea to check the license terms before using any open-source tool in a commercial project.

What are some best practices for using HTML Email Boilerplate?

Some best practices for using HTML Email Boilerplate include using semantic HTML, keeping your CSS inline, avoiding complex layouts, and testing your emails in various email clients and devices. It’s also important to keep your emails accessible and responsive, ensuring they look great and are easy to read on any device.

Where can I find more resources on HTML Email Boilerplate?

There are many online resources available for learning more about HTML Email Boilerplate. The official HTML Email Boilerplate website is a great place to start, and there are also many tutorials, articles, and forums available online. You can also check out the GitHub repository for the HTML Email Boilerplate for more information and updates.

Craig BucklerCraig Buckler
View Author

Craig is a freelance UK web consultant who built his first page for IE2.0 in 1995. Since that time he's been advocating standards, accessibility, and best-practice HTML5 techniques. He's created enterprise specifications, websites and online applications for companies and organisations including the UK Parliament, the European Parliament, the Department of Energy & Climate Change, Microsoft, and more. He's written more than 1,000 articles for SitePoint and you can find him @craigbuckler.

CSSCSS3emailhtml
Share this article
Read Next
Get the freshest news and resources for developers, designers and digital creators in your inbox each week