cssemailoutlookhtml-email

Conditional HTML/CSS in Outlook Emails in Office 365


Microsoft Outlook supports conditional CSS, which enables developers to create markup and styling that will supposedly only render on Outlook.
For example, from Outlook conditional CSS, the following snippet is supposed to be hidden across all Outlook clients.

<!DOCTYPE html>
<html>
<body>
<!--[if !mso]><!--> All Outlooks will ignore this <!--<![endif]-->
</body>
</html>

I tested this across a variety of devices and Outlook versions, and in every one of them, the text is still visible.

I do not have access to a Windows device so I suspect that might be the issue, but theoretically, this should work across all Outlooks, not just Outlook Windows.

I am using an Outlook account with the Office 365 subscription.

Screenshot from Outlook Desktop macOS 16.83.2:
Outlook Desktop macOS 16.83.2

Screenshot from Outlook Webmail Latest on macOS Safari:
Screenshot from Outlook Webmail Latest

Screenshot from Outlook iOS 4.2411.0:
Outlook iOS 4.2411.0


Solution

  • You have a misunderstanding of this, which is understandable as the guide you are using doesn't spell it out. They are referring to the Windows desktop version.

    Only the Windows desktop versions of Outlook use Microsoft Word as a rendering engine, and so only it has this conditional code.

    You can browse through different ways to target other Outlooks here, noting it's very rare to actually need these for anything other than Windows desktop Outlook: https://www.howtotarget.email/