2014-01-22 83 views
0

我想申請一個重複的背景爲一個html電子郵件表格單元格中,我使用的代碼http://backgrounds.cm/應用背景圖像表格單元格與VML

這是我的TD和包裝VML:

<td background="http://domain.com/Portals/0/emails/images/stripes-middle.png" bgcolor="#00ff00" width="346" valign="top"> 
    <!--[if gte mso 9]> 
    <v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width:346px;"> 
    <v:fill type="tile" src="http://domain.com/Portals/0/emails/images/stripes-middle.png" color="#ff0000" /> 
    <v:textbox style="mso-fit-shape-to-text:true" inset="0,0,0,0"> 
    <![endif]--> 
    <div> 
     <p>LOTS OF CONTENT IN HERE</p>                 
    </div> 
    <!--[if gte mso 9]> 
    </v:textbox> 
    </v:rect> 
    <![endif]--> 
</td> 

但是,它將我的背景圖像呈現在父表的左上角!不在表格單元格內。我怎樣才能解決這個問題?

+0

http://stackoverflow.com/questions/23280715/full-width-backgrounds-on-outlook-07-10-13 – davidcondrey

回答

1

爲什麼不把它嵌套在另一個表中呢?

<table border="0" cellpadding="0" cellspacing="0" width="640" style="border-collapse:collapse; padding:0; margin:0px;"> 
<tr valign="top"> 
    <td align="center" valign="top"> 
     <table border="0" cellpadding="0" cellspacing="0" width="346" style="border-collapse:collapse; padding:0; margin:0px;"> 
      <tr valign="top"> 
       <td background="http://domain.com/Portals/0/emails/images/stripes-middle.png" bgcolor="#ff0000" width="346" height="112" valign="top"> 
        <!--[if gte mso 9]> 
        <v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width:346px;height:112;"> 
        <v:fill type="tile" src="http://domain.com/Portals/0/emails/images/stripes-middle.png" color="#ff0000" /> 
        <v:textbox inset="0,0,0,0"> 
        <![endif]--> 
        <div> 
         <table border="0" cellpadding="0" cellspacing="0" width="346" style="border-collapse:collapse; padding:0; margin:0px;"> 
          <tr valign="top"> 
           <td align="left" valign="top"> 
            <p>LOTS OF CONTENT IN HERE</p> 
           </td> 
          </tr> 
         </table> 
        </div> 
        <!--[if gte mso 9]> 
        </v:textbox> 
        </v:rect> 
        <![endif]--> 
       </td> 
      </tr> 
     </table> 
    </td> 
</tr> 
</table> 

無法查出究竟你要去哪裏錯了,但我從來沒有使用嵌合形狀到文本前,這個片段中並沒有這樣做我錯了。