Skip to content

Instantly share code, notes, and snippets.

@juniorbird
Created September 11, 2015 19:37
Show Gist options
  • Save juniorbird/b0f934422bd60d2eb309 to your computer and use it in GitHub Desktop.
Save juniorbird/b0f934422bd60d2eb309 to your computer and use it in GitHub Desktop.
How to not have empty lines after images in e-mails.
<style="text/css">
.someclass a {
display: inline-block;
}
.someclass a img {
display: block;
}
</style>
<table>
<tr class="someclass">
<td class="someclass" style="margin: 0; font-size: 0; line-height: 0;">
<img src="your image here"><img src="your image here">
</td>
</tr>
</table>
@juniorbird
Copy link
Author

Note that all <img> tags must be on the same line. Don't wrap <img>s in block-level elements (inline elements, like <a>, are just fine).

If you don't do this, then you'll get a space that is neither padding nor margin between the two <img>s, if they're on different lines, in webmail readers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment