sgthemi
sgthemi

Reputation: 31

Conditional styling for Outlook by classes

Is it possible to use class selectors in conditional styling for Outlook 2007+?

If I have a cell with padding-top: 8px, can I override it by adding a class and styling that with conditional styling?

Here is my code right now, but the padding-top doesn't appear any different. The conditional styling is placed just above my normal styling in the email.

 <!--[if (gte mso 9)|(IE)]>
<style type="text/css">
    table {border-collapse: collapse;}
    .cta {padding-top: 12px !important;}
</style>
<![endif]-->


<td class="cta" width="125" align="left" valign="top" style="padding-top: 8px;">
<a href="http://google.com/"><img src="https://mlsvc01-prod.s3.amazonaws.com/6f8ceec6001/e21a0a7c-ccb7-4287-b1bb-52c626cd069e.jpg?ver=1469823545000" /></a>
</td>

Upvotes: 0

Views: 392

Answers (1)

DirtyRedz
DirtyRedz

Reputation: 566

Yes, you need to simply target the appropriate Microsoft Office version number.

For 2007 you want to target version 12

<!--[if gte mso 12]> <style type="text/css"> table {border-collapse: collapse;} .cta {padding-top: 12px !important;} </style> <![endif]-->

More on this here: http://templates.mailchimp.com/development/css/outlook-conditional-css/

Upvotes: 1

Related Questions