AB
1
Hiding Elements in All Instances of Outlook
Hi,
I've been scouring the internet for the past few hours and have come across oh so many contradicting articles, so thought I'd go straight to source and ask the professionals.
Is there a way of hiding elements, be it text or image from all instances of Outlook only (not just 2007 and 2013) I've used
style="mso-hide:all;display:none;max-height:0px;overflow:hidden;"
which does the trick however also hides in other clients.
Using a specific class for clients that allow webkit also doesn't seem to overwrite the above code.
Any advice would be appreciated.
Thanks,
Alex.
I have used this with some pretty good success. Hope it helps:
Cody - Thank you for this solution! It works very well when trying to hide an unsupported element because it appears to target only the Outlook (Word) rendering engine.
Hi,
If what you want is to target Outlook only, then you only need
mso-hide:all
. The other properties are there to hide element in other clients (display:none
is the generic one, andmax-height:0; overflow:hidden;
is used for Gmail).Hi Remi,
many thanks for getting back to me. It was my impression that adding mso-hide:all will still show in Outlook 2011, 2016 and Outlook.com.
Is there a way to hide these also?
Hi Alex,
You're right. In order to hide this content on Outlook.com (both the old and new version), I would suggest adding a
class
(for exampleclass="not-for-outlook"
) on the element you want to hide, and then the following styles :(The class
.ExternalClass
is there by default on the old Outlook.com. The new Outlook.com will strip attribute selectors, so[owa]
will be removed and thus the selector applied for this webmail only.)As for Outlook 2011 and 2016 (on OS X I presume), I'm not sure there's a way to target these client specifically, as they both run on WebKit. You'd risk hiding content on other clients as well.
Maybe a good question is why you'd want to hide content from these clients anyway ?
font-size:0px;
color: transparent;
width:0px;
height:0px;
Any of these will do..