Outlook 2007 Conditional Comments
Nov
14
I recently wrote an article detailing best practices for HTML email templates and I thought I would add one more item to the list. Conditional comments have saved me to many times for me to remember when building websites but I never thought they could help when building email templates, how wrong could I be.
For those of you that have attempted to implement an email template with a vaguely complex design in Outlook 2007 you will have hit many stumbling blocks with simple CSS attributes such as “background images” and “display”, to name but a few, not supported. Getting these templates as close to the original design as possible in all email clients whilst also offer a slightly degraded, yet more than acceptable version for Outlook 2007, is a very tricky and time consuming business. This is where conditional comments come in to play, as the example shows below:
<!--[if gte mso 9]>
Add your Outlook 2007 specific code here...
<![endif]-->
The above code snippet provides a much needed means to target Outlook 2007 specifically with styles and code to produce the degradation required to allow HTML templates to display correctly in such an awkward email client.
I would say long live conditional comments, however, I think I will take another tact, please please please Microsoft address Outlook’s support for CSS and for pity sake use the IE rendering engine and not MS Words. You have the market leading browser so use it… [Rant ends]
no comment
Hi, nice posts there
thank’s for the interesting information
Ha. You know it’s bad when you are begging for an IE rendering engine as a developer. From a strategic standpoint, HTML email is awesome for its ability to tap into user’s clickstream and purchasing habits. From a development standpoint, I have wanted to throw my keyboard on many occasions trying to get things to render consistently in all mail clients.
Some purists will have problems with using conditional comments, but I think its moot point since you use tables (nested tables at that) to do the layout for html emails.
very nice sites thanks admin…..
Thanx for great article.