Ronalds Vilciņš

Adding Outlook-only CSS to an HTML email

Outlook can render an HTML email differently from other clients. When one of those differences needs its own CSS, Microsoft conditional comments let you target Outlook without sending the rules to everyone else.

Place the conditional block after your main CSS:

<!--[if gte mso 9]>
  <style type="text/css">
    /* Your Outlook-specific CSS goes here. */
  </style>
<![endif]-->

gte mso 9 means Microsoft Office version 9 or newer. Email HTML is full of historical compromises, and this is one of the more useful ones when a normal rule cannot make Outlook cooperate.

Enjoyed reading this?

If you found this article helpful, consider supporting my writing. Every little bit helps keep this blog going.

← Back to all articles