0

我正在编写带有内嵌 HTML 的电子通讯。到目前为止,一切都很好,除了一个图像不会在其表格单元格中重复。在通讯的其余部分中,我一直在使用“repeat-y”图像,但是这个单元格不正常。有什么建议么?

这是代码:jsFiddle

     <table style="width:780px;">  
<tr>

<td style="width: 55px; background: #fffff url(http://25.media.tumblr.com/40e5aa33eb561f0148b1711a92d65043/tumblr_mpk3j3FRaa1snsew1o6_r1_100.jpg) left repeat-y;" valign="top">
    <img src="http://25.media.tumblr.com/40e5aa33eb561f0148b1711a92d65043/tumblr_mpk3j3FRaa1snsew1o6_r1_100.jpg" width="55" />
    </td>


<td style="background: #ffffff;" valign="top">
    <p style="text-align: right;">
        <span style="font-size:11px;"><span style="color: rgb(126, 146, 175);"><span style="font-family: 'trebuchet ms', helvetica, sans-serif;">texttexttexttexttexttext<br /> texttexttexttexttexttexttext<br /> texttexttexttexttexttexttext<br /> texttexttexttexttexttexttext<br /> texttexttexttexttexttexttext<br /> texttexttexttexttexttexttext<br /> texttexttexttexttexttexttext<br /> texttexttexttexttexttexttext<br /> texttexttexttexttexttexttext<br /> texttexttexttexttexttexttext<br /> texttexttexttexttexttexttext<br />
</td>
</tr>      
</table>

*编辑:最终的时事通讯将通过 iContact.com 发送,如果这有什么不同的话。

4

1 回答 1

0

您的 css 应该分离出背景声明。

注意,我在这里使用backgroundbackground-imagebackground-repeat声明:

<td style="width: 55px; background: #fffff; background-image:url(http://25.media.tumblr.com/40e5aa33eb561f0148b1711a92d65043/tumblr_mpk3j3FRaa1snsew1o6_r1_100.jpg); background-repeat:repeat-y" valign="top">

您也可以将背景颜色声明与图像/重复声明分开,并使用相同的背景标签,如下所示:

<td style="width: 55px; background: #fffff; background: url(http://25.media.tumblr.com/40e5aa33eb561f0148b1711a92d65043/tumblr_mpk3j3FRaa1snsew1o6_r1_100.jpg) repeat-y;" valign="top">

纠正重复后,您应该能够删除其他调用以显示图像:

<table style="width:780px;">  
<tr>
<td style="width: 55px; background: #fffff; background-image:url(http://25.media.tumblr.com/40e5aa33eb561f0148b1711a92d65043/tumblr_mpk3j3FRaa1snsew1o6_r1_100.jpg); background-repeat:repeat-y" valign="top">
</td>   
<td style="background: #ffffff;" valign="top">
    <p style="text-align: right;">
        <span style="font-size:11px;"><span style="color: rgb(126, 146, 175);"><span style="font-family: 'trebuchet ms', helvetica, sans-serif;">texttexttexttexttexttext<br /> texttexttexttexttexttexttext<br /> texttexttexttexttexttexttext<br /> texttexttexttexttexttexttext<br /> texttexttexttexttexttexttext<br /> texttexttexttexttexttexttext<br /> texttexttexttexttexttexttext<br /> texttexttexttexttexttexttext<br /> texttexttexttexttexttexttext<br /> texttexttexttexttexttexttext<br /> texttexttexttexttexttexttext<br />
        </span></span></span>
    </p>
</td>
</tr>      
</table>

这是更新的小提琴

编辑:请注意,您应该关闭开始创建有效 HTML 的标签。

于 2013-07-07T18:19:34.370 回答