Instead you can find all this information and more at https://howtotarget.email/
This is a list of tricks used to target individual email clients. These are hacky and likely to change, use it as a list of possible suggestions not a set of reliable rules.
.bloop_container .foo
_:-webkit-full-screen, :root .foo
and @media screen and (pointer) { .foo}
@media screen and (min-width:0\0){ .foo }
This broken media query will also show in Outlook 00-03 so may need to add an IE conditional comment.
_:-webkit-full-screen, :root .foo
This won't render on iOS devices but will render on desktop so may need a max-device-width media query.
body[style] div[style="margin: 16px 0; font-size: 80%"]
***AOL now uses Yahoo rendering but the previous hack was ***
.★:not(#★)
AOL respects a unicode name for a class but not for an ID, it will remove the ID completely from the element.
.body
AOL also removes class from the body tag so you can use .body
to avoid AOL
.Singleton .foo
_:-webkit-full-screen, _::-webkit-full-page-media, _:future, :root .foo
#edo-container .foo
Will cover both iOS and Android
.edo-email-view .foo
.edo .foo
#msgBody .foo
- The head and body structure of the email is removed, making content in the head, siblings of that in the body, so we can target this with;
meta ~ * .foo
ortitle ~ * .foo
Applies to Thunderbird, Freenet(title only), Orange.fr, Samsung
u + .body .foo
Gmail changes the doctype
to <u></u>
this is placed adjacent to a div that inherits class and id from the body tag.
div > u + .body .foo
This doesn't cover Inbox, only Gmail and only Android.
Work in progress. Any class or id name prefixed with an unsupported character will kill all the styles following it. These include &
, 1
, ★
, ~
.
body[style*="overflow-wrap:break-word"]
Small possibility this will cause conflict
*Work in progress. *Links have rel="noreferrer"
added. Strips a number of attributes including role
aria
data-
@supports (-webkit-overflow-scrolling:touch) and (color:#ffff) { .foo }
Works for 10+
Mobile - .cm_mail .foo
Desktop - #cm_mail_smart_body .foo
.body > div > div > .wrapper .foo
Nine inserts a couple of Div's between the body and the wrapper. Same hack also targets Samsung and possibly others.
.unused.foo
Only works on Notes 8, it will strip the unrecognised class and render the code behind.
Open-Xchange powers a number fo different email clients, including; Comcast, Libero, 1&1 MailXchange, Network Solutions Secure Mail, Namecheap Email Hosting, Mailbox.org, 123-reg Email, acens Correo Professional, Home.pl Cloud Email Xchange, Virgin Media Mail, Ziggo Mail. They prefix class and ID names with ox-
so we can target them with this
.foo[class^="ox-"]
Link to sanitizer docs Which appears to be built on top of DOMPurify List of email clients on wikipedia
The head and body structure of the email is removed, making content in the head, siblings of that in the body, so we can target this with; meta ~ * .foo
or title ~ * .foo
Applies to Thunderbird, Freenet(title only), Orange.fr, Samsung
.&
This is an invalid selector but works in MSO outlook.
To show content:
<!--[if mso]> <![endif]-->
<!--[if true]> <![endif]-->
<!--[if vml]> <![endif]-->
To hide content
<!--[if mso]><!--> <!--<![endif]-->
<!--[if false]> <![endif]-->
Other conditional
<!--[if IE]> <![endif]-->
<!--[if WindowsEdition]> <![endif]-->
_:-webkit-full-screen, _::-webkit-full-page-media, _:future, :root .body:not(.Singleton) .foo
The stuff before .body
will target webkit desktop apps on mac (Applemail and Outlook Mac), then we add the :not(.Singleton)
to remove Applemail.
This also targets Spark desktop app.
To be able to inspect element in Outlook Mac, and some other desktop Mac email clients, open terminal and paste in this line
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
[owa].foo
x:default .foo
Adding \0/
to the end of a style e.g. background:red\0/;
will also render in Apps and Outlook 2000-2003
body[data-outlook-cycle]
this attribute is added to both iOS and Android apps, also renders in webmail if you drop the body
and just use the attribute.
There appears to be some inconsistencies in app versions
body[style*="touch-action: manipulation;"] .foo
Sometime code in a linked style sheet will render.
body[data-outlook-cycle]
this attribute is added to both iOS and Android apps, also renders in webmail if you drop the body
and just use the attribute.
[data-outlook-cycle*="INSERT_STYLES"]
will target only non Microsoft email addresses @hotmail, @live, @outlook etc.
on iOS.
.moz-text-html .foo
Same hack as thunderbird, if rendering is different we can add to this.
#secdiv
#MessageViewBody
.body > div > div > .wrapper .foo
Samsung inserts a couple of Div's between the body and the wrapper. Same hack as Nine.- The head and body structure of the email is removed, making content in the head, siblings of that in the body, so we can target this with;
meta ~ * .foo
ortitle ~ * .foo
Applies to Thunderbird, Freenet(title only), Orange.fr, Samsung
_:-webkit-full-screen, _::-webkit-full-page-media, _:future, :root .body:not(.Singleton)
Same target as Outlook mac
.moz-text-html .foo
- This class is placed on a div inserted between the body and the wrapper so you can also do something like
body > div > .wrapper .foo
- The head and body structure of the email is removed, making content in the head, siblings of that in the body, so we can target this with;
meta ~ * .foo
ortitle ~ * .foo
Applies to Thunderbird, Freenet(title only), Orange.fr, Samsung
<!--[if false]> T-Online <![endif]-->
or <!--[if !true]> T-Online <![endif]-->
Supports ANY conditional comment but needs to be something valid so IE Outlooks don't show it.
_:-ms-input-placeholder, :root .foo
_:-ms-fullscreen, :root .foo
These are from very old test, possible overlaps with Windows Phone.
.& .foo{}
Yahoo and AOL will replace the .&
with their wrapping id name. It can also be used to target element selectors .&h1{}
and the wrapping div itself .&{}
@media screen yahoo{ .foo }
Yahoo & AOL remove invalid media query selectors so will render the above as @media screen {}
. Yahoo doesn't support max-device-width
so makes it tricky to split mobile but we can use max-width
We can also separate yahoo from AOL using id="★foo"
which AOL will strip out but yahoo will leave. AOL also strips <title>
and empty <style>
elements
(tbc)
Android will ignore styles in the head. We can change this by adding an additional head before the real head. <head></head><head> - styles etc. - </head>