Automatically resizing a VML background image in Outlook

拜拜、爱过 提交于 2019-12-20 05:58:06

问题


I know about the Bulletproof Email Backgrounds hack, but as this places a set-sized VML rectangle in the background, and then places the content within it, it doesn't resize.

Or to put it another way, the text in the table cell is cropped to the height of VML rectangle.

I've tried everything I can think of, but there doesn't appear to be anyway to allow the content of the VML rectangle to resize it.

Is there ANY other way of getting background images in Outlook?


回答1:


Besides VML, the only other way to get a background image in Outlook is in the body tag.

Here is the technique (works in all major clients):

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
</head>
<body style="margin: 0px; padding: 0px; background-image: url('http://lorempixel.com/100/100/'); background-color: #252525; background-repeat: repeat-y no-repeat; background-position: top left;" bgcolor="#252525">
<!-- BODY FAKE PANEL -->
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" background="http://lorempixel.com/100/100/">
  <tr>
    <td valign="top">
<!-- CENTER FLOAT -->
      <table width="600" height="800" border="0" valign="top" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
        <tr>
          <td align="center">
Center panel
          </td>
        </tr>
      </table>
<!-- /CENTER FLOAT -->
    </td>
  </tr>
</table>
<!-- /BODY FAKE PANEL -->
</body>
</html> 


来源:https://stackoverflow.com/questions/17239098/automatically-resizing-a-vml-background-image-in-outlook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!