0

刚刚为 gmail 创建了一个电子邮件模板

这是我的html代码。

 <!doctype html>
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <title>dance</title>
 </head>

 <body>
 <table style="background-color: #ffffff; border-collapse:collapse;border-spacing: 0;margin:0 auto;" border="0" cellpadding="0" cellspacing="0" width="100%" align="center">
     <tr>
         <td>
             <table align="center" border="0" cellpadding="0" cellspacing="0">
                 <tr>
                     <td><a href="http://www.xxx.net.au/" title="title"><img src="images/top_logo_03.png" alt="title" width="657" height="252" border="0" style="display:block"/></a></td>
                </tr>
                </table>

                </td>
                </tr>
   <tr>
                     <td><a href="http://www.xxx.net.au/" title="title"><img src="images/top_logo_03.png" alt="title" width="657" height="252" border="0" style="display:block"/></a></td>
                </tr>
                </table>

                </td>
                </tr>
         <tr>
                     <td><a href="http://www.xxx.net.au/" title="title"><img src="images/top_logo_03.png" alt="title" width="657" height="252" border="0" style="display:block"/></a></td>
                </tr>
                </table>

                </td>
                </tr>
                </table>
                </body>
                </html>

它仅显示 1 张图像,而其他图像未显示..

需要帮助我做错了什么?

4

6 回答 6

1

如果您检查代码,则表结构不正确。对于图像的第一行,您添加了表格的结束标记。对于第 2 行和第 3 行图像,</table>有额外的标签 of ,这会导致不显示这些图像的错误。HTML 代码如下所示。

<!doctype html>
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <title>dance</title>
 </head>

 <body>
 <table style="background-color: #ffffff; border-collapse:collapse;border-spacing: 0;margin:0 auto;" border="0" cellpadding="0" cellspacing="0" width="100%" align="center">
    <tr>
        <td>
            <table align="center" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        <a href="http://www.xxx.net.au/" title="title"><img src="images/top_logo_03.png" alt="title" width="657" height="252" border="0" style="display:block"/></a>
                    </td>
                </tr>
                <tr>
                    <td>
                        <a href="http://www.xxx.net.au/" title="title"><img src="images/top_logo_03.png" alt="title" width="657" height="252" border="0" style="display:block"/></a>
                    </td>
                </tr>
                <tr>
                    <td>
                        <a href="http://www.xxx.net.au/" title="title"><img src="images/top_logo_03.png" alt="title" width="657" height="252" border="0" style="display:block"/></a>
                    </td>
                </tr>
            </table>
        </td>
    </tr>

</table>
</body>
</html>
于 2014-03-26T09:46:47.690 回答
1

如果您仔细查看您在此处发布的代码;最后一张图片应该在表格内,但它只有一个结束标签</table><table>布局中缺少打开标记。

于 2014-03-26T09:36:52.983 回答
1

您是否尝试过为图像提供完整的 URL(即http://<your_site_url>/images/top_logo_03.png)而不是 images/top_logo_03.png??

请检查此代码。

 <table style="background-color: #ffffff; border-collapse:collapse;border-spacing: 0;margin:0 auto;" border="0" cellpadding="0" cellspacing="0" width="100%" align="center">
    <tr>
     <td>
        <table align="center" border="0" cellpadding="0" cellspacing="0">
             <tr>
                 <td><a href="http://www.xxx.net.au/" title="title"><img src="images/top_logo_03.png" alt="title" width="657" height="252" border="0" style="display:block"/></a></td>
            </tr>
        </table>
     </td>
    </tr>
    <tr>
     <td>
        <table align="center" border="0" cellpadding="0" cellspacing="0">
             <tr>
                 <td><a href="http://www.xxx.net.au/" title="title"><img src="images/top_logo_03.png" alt="title" width="657" height="252" border="0" style="display:block"/></a></td>
            </tr>
        </table>
     </td>
    </tr>
    <tr>
     <td>
        <table align="center" border="0" cellpadding="0" cellspacing="0">
             <tr>
                 <td><a href="http://www.xxx.net.au/" title="title"><img src="images/top_logo_03.png" alt="title" width="657" height="252" border="0" style="display:block"/></a></td>
            </tr>
        </table>
     </td>
    </tr>
</table>
于 2014-03-26T09:37:15.867 回答
1

您需要将图像放在服务器上

<a href="http://www.xxx.net.au/" title="title"><img src="http://www.yourserver.com/images/top_logo_03.png" alt="title" width="657" height="252" border="0" style="display:block"/>

路易吉

于 2014-03-26T09:37:52.543 回答
0

你的代码是错误的:试试看:

<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml">
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <title>dance</title>
   </head>
   <body>
      <table style="background-color: #ffffff; border-collapse:collapse;border-spacing: 0;margin:0 auto;" border="0" cellpadding="0" cellspacing="0" width="100%" align="center">
         <tr>
            <td>
               <table align="center" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                     <td><a href="http://www.xxx.net.au/" title="title"><img src="images/top_logo_03.png" alt="title" width="657" height="252" border="0" style="display:block"/></a></td>
                  </tr>
               </table>
            </td>
         </tr>
         <tr>
            <td><a href="http://www.xxx.net.au/" title="title"><img src="images/top_logo_03.png" alt="title" width="657" height="252" border="0" style="display:block"/></a></td>
         </tr>
      <tr>
         <td><a href="http://www.xxx.net.au/" title="title"><img src="images/top_logo_03.png" alt="title" width="657" height="252" border="0" style="display:block"/></a></td>
      </tr>
      </table>

   </body>
</html>

你放错了一些标签

于 2014-03-26T16:47:43.230 回答
0

首先查看您的代码,您可以看到您的表结构不正确。尝试纠正它。
其次,您为图像使用了相对路径。尝试为您的图像使用绝对路径。
对于 Ex-
而不是<img src="images/xyz.gif: />,使用<img src="http:""www.example.com/images/xyz.gif">

于 2014-06-17T06:35:18.007 回答