简体   繁体   English

如何在Outlook 2007中运行的HTML电子邮件中进行后台重复?

[英]How to do background-repeat in an HTML email that works in Outlook 2007?

I am constructing a HTML email for clients and would like to have a content area that expands to fit the text. 我正在为客户构建一个HTML电子邮件,并希望有一个扩展到适合文本的内容区域。 I would like the border of the container to have a shadow effect- which means repeating a 1px image vertically down each side. 我希望容器的边框具有阴影效果 - 这意味着在每一侧垂直向下重复1px图像。 I have been very careful to use well-supported (and often legacy) tags and stylings so that it displays correctly in as many email clients as possible. 我一直非常小心地使用支持良好(通常是遗留的)标签和样式,以便在尽可能多的电子邮件客户端中正确显示。 However, I cannot get background-repeat working in Outlook 2007. I have also tried setting its height to 100% with mixed results. 但是,我无法在Outlook 2007中使用后台重复工作。我也尝试将其高度设置为100%,结果不一致。

I'm actually using the background attribute in a td at the moment as the background styling did not work at all for popular clients (gmail, thunderbird). 我实际上是在td中使用background属性,因为背景样式根本不适用于流行的客户端(gmail,thunderbird)。 Can anyone think of a workaround I could use? 任何人都可以想到我可以使用的解决方法吗?

If not, is there a way to detect if an email is being displayed in Outlook 2007 so that I could look into removing shadow images for the entire email? 如果没有,有没有办法检测Outlook 2007中是否显示了电子邮件,以便我可以查看删除整个电子邮件的阴影图像?

Many thanks 非常感谢

This should work: 这应该工作:

background-image: url('/bg.jpg');
background-repeat: repeat-y no-repeat;
background-position: top center;
background-color: white;

Notice the repeat-y and no-repeat. 注意repeat-y和no-repeat。 You need both or Outlook 2007 will assume repeat-x too. 您需要两者或Outlook 2007也将假设repeat-x。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM