Problem with height="1" in email

I have an email newsletter that I have designed. Several places there are 1px rules that I have coded as follows:

<tr height="1">
    <td width="30" height="1"></td>
    <td height="1" width="540" colspan="5" bgcolor="#cccccc"></td>
    <td width="30" height="1"></td>
</tr>

But when the code gets to email clients, the height is 11px. Can anyone provide feedback on this?

Thanks in advance

Dave Dave, 7 years ago

Hi, this really depends on which email client you're using. Many of them have poor margin and padding support (such as Gmail and Outlook 2007). Can you provide any more details?

zapatoche, 7 years ago

I did a quick test on Outlook XP, Hotmail, Yahoo, lycos, Gmail, AOL mail
and it work fine. You probably tried it out of desperation but you can't specify a height on the <tr>
Validate your code to check if there is an error somewhere which could force your layout to display improperly, or check if adjacent cells don't have a height set.

If you have a non breakable space in the cell it won't collapse.

Can't say more like this.

jmp909, 7 years ago

try this...

<tr>
    <td width="30" height="1"></td>
    <td height="1" width="540" colspan="5" bgcolor="#cccccc"><img src="images/spacer.gif" width="540" height="1" alt="" style="display:block"></td>
    <td width="30" height="1"></td>
</tr>

Mathew Mathew, 7 years ago

I recall in the early days of web design having to explicitly set a line height because some browsers would reserve a default amount of space even with no text in there.

So you might also want to try that.


Get in touch with us on Twitter: http://twitter.com/campaignmonitor
We're also on Facebook: http://facebook.com/campaignmonitor

Join 200,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free
1-888-533-8098