Last active
October 3, 2019 16:10
-
-
Save fivedoor-gists/9652cc35f9dd060aa0bdd85b7839aa9d to your computer and use it in GitHub Desktop.
email-hide_content
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
/* Media query for displaying content in mobile email clients */ | |
@media only screen and (max-device-width: 480px) { | |
.hide { max-height: none !important; font-size: 12px !important; display: block !important; } | |
} | |
/* CSS for hiding content in desktop/webmail clients */ | |
.hide { max-height: 0px; font-size: 0; display: none; } | |
</style> | |
<!-- Content to hide in desktop/webmail clients, display in mobile --> | |
<p class="hide">Download from the App Store</p> | |
<!-- Image to hide in desktop/webmail clients, display in mobile --> | |
<div class="hide"><img src="..." class="hide" /></div> | |
<!-- https://www.campaignmonitor.com/blog/email-marketing/2019/04/hiding-content-in-both-desktop-and-web-email-clients/--> | |
<!-- https://freshinbox.com/blog/bulletproof-solution-to-hiding-mobile-content-when-opened-in-non-mobile-email-clients/--> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment