November 28, 2014

Revisiting Style Resets in Email

If you’ve been involved in web design for more than a few years, you’re likely familiar with resets. Resets are bits of code used to whip browsers into shape and provide a baseline of rendering. They, as their name suggests, reset some of those browser quirks and make it easier to design and code more consistent web experiences. Popular resets include Eric Meyer’s classic and my favorite, Normalize.

Now, if you’ve been involved in email design, you’re likely aware that email clients are riddled with quirks and bugs. Which typically makes coding an email that renders consistently across clients a chore. While striving for pixel-perfect designs between email clients is fodder for another post, the idea of a reset for HTML email does exist.

As an example, here’s the reset code that I typically use.

<!DOCTYPE html>


See the Pen The Reset by Jason Rodriguez (@rodriguezcommaj) on CodePen.

</div> It's similar to the code that made its way into the [Salted]( and [Author](/author-template) templates, and is derived from our [Litmus newsletter template]( Each rule targets a specific email client quirk. From top to bottom, they are: - Forcing a *view in browser* message in Outlook - Getting Hotmail to display full-width emails - Get Hotmail to display normal line spacing - Stop Webkit and Windows Mobile from changing text sizes - Remove spacing between tables in Outlook 2007+ - Improve resized image rendering in Internet Explorer - Some sane defaults for the body, images, and tables - Handling iOS blue links In the midst of [writing a new book]( and preparing material for a [Front End Masters Workshop](, I'm wondering whether all of these rules still make sense. At first blush, Hotmail as a product is dead, having been replaced by I'm admittedly the worst when it comes to keeping up with and understanding Microsoft products (, OWA, 365, WTF?), so I wouldn't be surprised if some updates were made to affect the rendering of those reset styles. In particular, James White [recently reported]( some improvements to OWA rendering, including some sanity when it comes to line heights. Will that affect, too? More importantly, do we need to add anything to account for newer developments in email clients? Or should we add in some boilerplate to handle different coding styles? I know a few people–looking at you, [Fabio](–prefer using semantic elements and resetting their styles instead of the *all styling on the table cell* approach that I favor. When releasing templates out into the wild or sharing code, should some resets for those elements be involved? I'd love to hear what everyone else is doing for resets in HTML email. [Drop me an email]( or [tweet at me]( and let me know. Or fork the sample above on [Codepen]( and write your own reset.