Web vs. Email Development

ow many web developers out there were around when table-based layouts and inline styling were in vogue? Ask anyone who has been coding before the modern web what it was like and they’ll say that we’ve come a long way.  With the proliferation of modern CSS techniques, the adoption of accessibility in design, and a strong focus towards web standards, tables are now used for what they were originally intended for—displaying tabular data.

Unless you’ve been coding HTML since the late 90’s and/or work in a shop that develops emails for clients, you may not have formal experience in coding an HTML email.  This is not a guide or a deep dive, but a brief overview of what I found helpful when starting to work with HTML for email.

Doctype
Email Marketing Design

  • DOCTYPES are not required for email. Since the information in the <head> tag can be stripped out, a DOCTYPE shouldn’t be defined. In some cases, you can probably leave out the <head> section altogether.

Layout
Email Marketing Design

  • Since style sheet support is not consistent from client to client, use tables to achieve your preferred layout.  Also, stay away from <div> tags and margins.  Layouts that are built around<div>s and margins could yield unfavorable results when you test.

Style Sheets
Email Marketing Design

  • While most web developers know that inline styling should be avoided if possible, this doesn’t apply when styling elements in an email.  Inline styling is the preferred method for applying CSS properties to your design. While support for style sheets is on the rise, you must still code for the lowest common denominator— the email client that doesn’t support this feature.
  • Read more about CSS Support for Email.

Block-Level Elements (<h1>, <h2>, <ul>, <p>)
Email Marketing Design

  • While block-level elements are supported in many email clients, it is good to remember that not all clients support style-sheets.
  • You may also run into challenges when using padding and margins through various email clients.  Since <span> tags have a default margin/padding of zero, this would be a good starting point as an alternative to using block-level elements.

Float
Email Marketing Design

  • Previously mentioned, there are emails clients that support the float property.  As you’ll likely want to code in a way that achieves the best possible rendering performance in all the major email clients, you should avoid this property.  A suitable alternative would be to use nested tables. Using tables, you will achieve better control over your layout, resulting in pixel-perfect email designs.
Developing HTML for email is by no means at the forefront of modern day web development. While it  might seem antiquated at times, these methods were actually once a very modern and standard practice. Until email standards exist, grasping the fundamentals of email development and careful testing for rendering are crucial skill sets that every web developer should possess in their bag of tricks.
For a deeper look at HTML for Email and other related questions, be sure to check out the ExactTarget Design Center on 3sixty!

 

You may also like...

Leave a Reply