Link dump: Sept 7, 2006 – Using CSS and HTML in email
A round up of posts and articles about using CSS with HTML in email, with varying degrees of crustiness.
- How to Code HTML Email Newsletters – Lots of good bits at the bottom
- Designing, Coding & Delivering HTML Email [PDF] – from the MailChimp folks who are personal acquaintances of mine.
- Optimizing CSS presentation in HTML emails
- CSS and Email, Kissing in a Tree
- StyleInEmail from CSS-d
The big ol’ pitfall in using CSS in HTML emails is two-fold:
- There are scads of different e-mail clients.
- CSS support, if it exists, is usually quirky.
Using CSS in email is possible, though. I’ll distill the best advice into four points:
- Use simple HTML. Go for 3.2 or HTML 4.1.
- If appearance is your primary concern, use tables for layout. You can use the div element. Just be aware that your users may receive linearized text instead of your floated div goodness.
- Use highly-specific selectors. Give that wrapper div or that table an id. Use elements and ids or classes as selectors (example td.main).
- Use inline styles. For the greatest level of consistency, use inline styles. Yes it sort of defeats the purpose of using CSS.
Oh, and by all means, make your CSS embedded (included in the HTML file), not linked.