Empty DIV with 1px height becomes 2px high in Outlook 2007 & 2010

Hi forum,

for the life of me I can't seem to be able to make Outlook 2007 & 2010 show an empty div with single pixel height.

The code is as follows:

<div height="1" 
style="height: 1px; font-size: 1px; background-color: blue;">
<img style="display:block;" src="http://666kb.com/i/cajepbho4e1p05f5g.gif" height="1" width="1"/>

(the image inside the div is a 1x1 transparent GIF pixel image)

All mail clients render the single pixel height DIV perfectly, with the only exception of Outlook 2007 & 2010, which insist to display the DIV 2 pixels high.

Thanks heaps already to everyone for any ideas how to convince Outlook 2007 and 2010 to also show the DIV only with 1 pixel height,

Cheers David.P

Step, 4 years ago

Hey David

Have you attempted the same appoach with a <td> instead as they're better supported for Outlook ?

<td height="1" bgcolor="Blue" style="font-size: 1px;"><img style="display:block;" src="http://666kb.com/i/cajepbho4e1p05f5g.gif" height="1" width="1"/></td>


A email developer obsessed with gym, coding, design, music, and other things he doesn't understand. Twitter - http://twitter.com/#!/stephenho1mes
David.P, 4 years ago

Thanks Step,

yes I have actually tried <td> already, however there is another problem with <td>: the exact (vertical) placement of the <td>'s is different in different browsers (and mail clients, respectively), see here:

http://stackoverflow.com/questions/1421 … -to-bitmap

This is why I think there is no other way than using 1px divs instead :(

Still thankful for every idea how to force Outlook 2007 and 2010 to show a DIV with 1 pixel height,

Cheers David.P

David.P, 4 years ago

I fixed it!

...by adding

max-height: 1px; line-height: 1px;

to the style of the DIV's!

Yippie Ki Yay!

Cheers David.P

roshodgekiss roshodgekiss, 4 years ago

Superb, David - thanks for sharing your fix! That's awesome :D

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

Good Work, max-height doesn't appear to be supported in 07/10 but line-height certainly is, as a rule, if its an image within a td/div then Outlook will respect the line height you set, if it's text (i.e. &nbsp;) then regardless of font size Outlook will enforce a default minimum line height unless you overriide it, hope that helps.

Gmail app apologist

See why 200,000 companies worldwide love Campaign Monitor.

From Australia to Zimbabwe, and everywhere in between, companies count on Campaign Monitor for email campaigns that boost the bottom line.

Get started for free