Community Forum

Over the years we have built up a community of email marketers, coders and designers that live and breathe email.

Use the Email on Acid Forum like your virtual water cooler: Stop by to discuss email code, quirky clients and fixes and post your issues (with an example of the code) for our community to offer its assistance.

 
   
How to Target Outlook.com and Yahoo

memberhub

Newbie
Total Posts:  2
Posted: 22 June 2017 05:43 AM

Hey folks,

I’m having a hard time using “display: none !important;” and targeting Outlook.com. Essentially I have two image at the top of the email and I’m hiding the bigger one on mobile devices and showing the larger one on Desktop. All is well with all clients accept Outlook.com (office 365) and Yahoo!

I did read this post here: https://www.emailonacid.com/blog/article/email-development/tips_and_tricks_outlook.com#outlook_dot_com_tip7

And that was helpful but I can’t seem to get this right: 

[owa] .square_ad { display: none !important; }

Not only does it not hide the square ad, it’s causing the square ad to NOT show up on mobile which is what I want.

ANY HELP would be MUCH appreciated.

<style type="text/css">

      
[owa] .square_ad { displaynone !important}
       
@media only screen and (max-device-width480px{
        body[yahoo] 
#container1 {display:block !important}
        
body[yahoo] p {font-size12px}
        
.leaderboard_ad {displaynone !important;}
      }
      
@media only screen and (min-device-width768px{
        body[yahoo] 
#container1 {display:block !important}
        
body[yahoo] p {font-size14px}
        body[yahoo]  
.square_ad {displaynone !important;}
        
.square_ad {displaynone !important;}
      }
    
</style>
    <!--
[if gte mso 9]>
        <
style type="text/css">
        .
square_ad {displaynone !important;}
        
</style>
    <!
[endif]--> 

 

Alex Ilhan

Avatar
Administrator
Total Posts:  210
Posted: 22 June 2017 11:37 PM
[ # 1 ]

Hi Memberhub!

Thanks for joining us over here on the EoA forums.

Would you mind sharing your full code with me, please, by attaching it as a .HTML file to your post. I’ll take a look at it once it’s uploaded!

Cheers
Alex


 

memberhub

Newbie
Total Posts:  2
Posted: 23 June 2017 04:45 AM
[ # 2 ]

Thank you!! This is actually .erb but I saved it as .html

File Attachments
notification_mailer.text.html  (File Size: 7KB - Downloads: 146)