I am trying to send a simple HTML EDM on Outlook. The HTML simply contains a table wrapped around an image (the content of my EDM), of which I could attach into Outlook and insert as text, along with an attachment of the image file.
The original image size is around width 600px and height 2500px. I wish to have the image displayed at width 100%.
I understand there are some styling constraints for MSO. I have managed to achieve the 100% width with the following code, however, the image seems to be pushed up vertically off the email body, meaning that a good quarter of the top of image cannot be seen, as if it's been cut off.
The following is the code I have written:
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>My Marketing Newsletter</title>
</head>
<body>
<table width="100%" height="auto">
<tr>
<td>
<img src='cid:Email.png' style="display:block"/>
</td>
</tr>
</table>
</body>
</html>
I have referenced from this entry to not use line-height and to make use of display: block
, but still no resolution. Why?
Updated
This is how the results look like, note that they are mimicked and not the real screenshots.
How I thought it should look like (100% width, height: auto): https://i.stack.imgur.com/o94Hv.png
How it turned out like: https://i.stack.imgur.com/k9zzI.png
How it looks like with padding-top given to td or table: https://i.stack.imgur.com/3rqdD.png
How it looks like without the table: https://i.stack.imgur.com/cqoV8.png