Reputation: 968
I'm having problem hiding images properly in outlook 2013, even though they are hidden they add a line of spacing where they have been hidden making the email look stretched. This is the code I have on the image that I want to hide from the desktop version.
<tr style="display: none; line-height: 0; font-size: 0; height: 0; padding: 0; mso-hide: all;">
<td width="20" style="display: none; line-height: 0; font-size: 0; height: 0; padding: 0; mso-hide: all;" class="spacer-width">
<img class="spacer-width" src="spacer.gif" height="0" width="0" style="display: none; line-height: 0; font-size: 0; height: 0; padding: 0; mso-hide: all;" alt="" />
</td>
<td width="560" style="display: none; line-height: 0; font-size: 0; height: 0; padding: 0; mso-hide: all;" class="secondary-fullwidth">
<img src="btn-8.gif" height="0" width="0" style="display: none; line-height: 0; font-size: 0; height: 0; padding: 0; mso-hide: all;" class="btn-two" alt="Request A Test Drive" />
</td>
<td width="20" style="display: none; line-height: 0; font-size: 0; height: 0; padding: 0; mso-hide: all;" class="spacer-width">
<img class="spacer-width" src="spacer.gif" height="0" width="0" style="display: none; line-height: 0; font-size: 0; height: 0; padding: 0; mso-hide: all;" alt="" />
</td>
</tr>
Thanks for any help
Upvotes: 2
Views: 6200
Reputation: 724
I use the following fix to hide the content from Outlook 2007 and up:
<!--[if !gte mso 9]><!---->
<tr style="display: none; line-height: 0; font-size: 0; height: 0; padding: 0; mso-hide: all;">
<td width="20" style="display: none; line-height: 0; font-size: 0; height: 0; padding: 0; mso-hide: all;" class="spacer-width">
<img class="spacer-width" src="spacer.gif" height="0" width="0" style="display: none; line-height: 0; font-size: 0; height: 0; padding: 0; mso-hide: all;" alt="" />
</td>
<td width="560" style="display: none; line-height: 0; font-size: 0; height: 0; padding: 0; mso-hide: all;" class="secondary-fullwidth">
<img src="btn-8.gif" height="0" width="0" style="display: none; line-height: 0; font-size: 0; height: 0; padding: 0; mso-hide: all;" class="btn-two" alt="Request A Test Drive" />
</td>
<td width="20" style="display: none; line-height: 0; font-size: 0; height: 0; padding: 0; mso-hide: all;" class="spacer-width">
<img class="spacer-width" src="spacer.gif" height="0" width="0" style="display: none; line-height: 0; font-size: 0; height: 0; padding: 0; mso-hide: all;" alt="" />
</td>
</tr>
<!--<![endif]-->
Upvotes: 1
Reputation: 312
try adding visibility:hidden; to the css. It has support in Outlook and I remember somewhere that the "new" Internet Explorer (maybe I was working with 8 at the time) needed both to properly hide something.
Upvotes: 0