2014-09-11 20 views
0

我有一个行和4列的表。在第一行,我想用影像回地面(中心)的单个TD和背景image.I做到这一点的中心使用如何在HTML邮件中的背景图像的准确位置写文本?

<table> 
<tr> 
<td colspan="4"style="background-image: url(ribbon.png);background-position:center;background-repeat: no-repeat;text-align: center; vertical-position:bottom;color: white;font-weight: bold;">Analysis of Result</td> 
</tr> 
</table> 

现在回地面图像是在表格单元格的中心(某些文本TD)。文本位于表格单元的中心,不在背景图像的中心。建议我这样做。

回答

0

我强烈建议你找到一个新的方法来做到这一点,因为你当前的代码的客户端兼容性最好是平庸的。 vertical-position,text-align,以及你所有的背景CSS都得不到支持。现在,每个在Outlook中打开此电子邮件的人都会在表格单元格左上角的黑体字Times New Roman中看到“结果分析”。

习惯使用<td align="center" valign="middle">来对齐文本。背景无法在Outlook中对齐,所以我建议围绕此设计。

https://www.campaignmonitor.com/css/

^不过说真的,看到试试,如果你能完成你所需要的通过HTML CSS尝试之前属性。

+0

在outlook中的背景:http://backgrounds.cm/ – zazzyzeph 2014-09-11 20:14:25