html - 验证服务 - 电子邮件消息验证失败

标签 html css xhtml

我正在尝试使用 XHTML 文档创建电子邮件 HTML 模板。 我试图使用“标记验证服务”来测试文档,但没有成功。我遇到了 2 个错误,我试图弄清楚并做了一些更改,但没有解决。

这是我的代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <title>Welcome</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Lato" />
</head>
<body style="margin: 0; padding: 0;">
 <table border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
   <td>
     <table align="center" border="0" cellpadding="0" cellspacing="0" width="600" style="border-collapse: collapse; border: 1px solid #cccccc;">
       <tr>
         <td align="center" bgcolor="#70bbd9" style="padding: 2px 2px 2px 2px;">
          <img src="img/coffee2.jpg" alt="Welcome to Cricket" width="600" height="400" style="display: block;" />
         </td>
       </tr>
       <tr>
         <td bgcolor="#ffffff" style="padding: 10px 30px 20px 30px;">
           <table border="0" cellpadding="0" cellspacing="0" width="100%">
            <tr>
             <td style="padding: 10px 0 20px 0; font-family:lato; line-height: 140%;">
              We're so happy!!!
              <br/>
              We founded this because we wanted to create a trustworthy app.
             </td>
            </tr>
            <tr>
             <td>
               <table border="0" cellpadding="0" cellspacing="0" width="100%">
                <tr>
                 <td width="260" valign="top">
                  <table border="0" cellpadding="0" cellspacing="0" width="100%">
                   <tr>
                    <td>
                     <img src="img/testimonial-bg.jpg" alt="" width="100%" height="140" style="display: block;" />
                    </td>
                   </tr>
                   <tr>
                    <td style="padding: 10px 0 0 0; font-family:lato; line-height: 140%;">
                     <h4>Extension</h4>
                     <a href="http://www.google.com"><button style="margin:33px 0 0 15px;color: black;padding: 15px 32px;text-align: center;text-decoration: none;display: inline-block;
    font-size: 14px; background-color: Transparent;
    background-repeat:no-repeat;
    border: 1px solid black;
    cursor:pointer;overflow: hidden;outline:none;">GET THE EXTENSION</button></a>
                    </td>
                   </tr>
                  </table>
                 </td>
                 <td style="font-size: 0; line-height: 0;" width="20">
                  &nbsp;
                 </td>
                 <td width="260" valign="top">
                  <table border="0" cellpadding="0" cellspacing="0" width="100%">
                   <tr>
                    <td>
                     <img src="img/technology-1940695_1920.jpg" alt="" width="100%" height="140" style="display: block;" />
                    </td>
                   </tr>
                   <tr>
                    <td style="padding: 10px 0 0 0; font-family:lato;line-height: 140%;">
                    <h4>Application</h4>
                     <a href="http://www.google.com"><button style="margin:10px 0 0 50px;color: black;padding: 15px 32px;text-align: center;text-decoration: none;display: inline-block;
    font-size: 16px; background-color: Transparent;
    background-repeat:no-repeat;
    border: 1px solid black;
    cursor:pointer;overflow: hidden;outline:none;">GET THE APP</button></a>
                    </td>
                   </tr>
                  </table>
                 </td>
                </tr>
               </table>
             </td>
            </tr>
           </table>
         </td>
       </tr>
       <tr>
         <td bgcolor="#363940" style="padding: 30px 30px 30px 30px;">
           <table border="0" cellpadding="0" cellspacing="0" width="100%">
             <td width="90%" style="font-family:lato; color:#ffffff;">
              &reg; Copyright &copy; 2017 <br/>
             </td>
             <td align="right">
              <table border="0" cellpadding="0" cellspacing="0">
               <tr>
                <td style="font-size: 0; line-height: 0;" width="20">&nbsp;</td>
                <td>
                 <a href="http://www.facebook.com/">
                  <img src="img/fb.gif" alt="Facebook" width="38" height="38" style="display: block;" border="0" />
                 </a>
                </td>
               </tr>
              </table>
             </td>
            </table>
         </td>
       </tr>
     </table>
   </td>
  </tr>
 </table>
</body>
</html>

我错过了什么? 谢谢。

最佳答案

标记验证服务说:

Line 84, Column 70: document type does not allow element "td" here; assuming missing "tr" start-tag

A <td>必须在 <tr> 内.

<table>
  <tr>
    <td></td>
  </tr>
</table>

这是 HTML。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <title>Welcome</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Lato" />
</head>

<body style="margin: 0; padding: 0;">
  <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
      <td>
        <table align="center" border="0" cellpadding="0" cellspacing="0" width="600" style="border-collapse: collapse; border: 1px solid #cccccc;">
          <tr>
            <td align="center" bgcolor="#70bbd9" style="padding: 2px 2px 2px 2px;">
              <img src="img/coffee2.jpg" alt="Welcome to Cricket" width="600" height="400" style="display: block;" />
            </td>
          </tr>
          <tr>
            <td bgcolor="#ffffff" style="padding: 10px 30px 20px 30px;">
              <table border="0" cellpadding="0" cellspacing="0" width="100%">
                <tr>
                  <td style="padding: 10px 0 20px 0; font-family:lato; line-height: 140%;">
                    We're so happy!!!
                    <br /> We founded this because we wanted to create a trustworthy app.
                  </td>
                </tr>
                <tr>
                  <td>
                    <table border="0" cellpadding="0" cellspacing="0" width="100%">
                      <tr>
                        <td width="260" valign="top">
                          <table border="0" cellpadding="0" cellspacing="0" width="100%">
                            <tr>
                              <td>
                                <img src="img/testimonial-bg.jpg" alt="" width="100%" height="140" style="display: block;" />
                              </td>
                            </tr>
                            <tr>
                              <td style="padding: 10px 0 0 0; font-family:lato; line-height: 140%;">
                                <h4>Extension</h4>
                                <a href="http://www.google.com">
                                  <button style="margin:33px 0 0 15px;color: black;padding: 15px 32px;text-align: center;text-decoration: none;display: inline-block;
    font-size: 14px; background-color: Transparent;
    background-repeat:no-repeat;
    border: 1px solid black;
    cursor:pointer;overflow: hidden;outline:none;">
																		GET THE EXTENSION
																	</button>
                                </a>
                              </td>
                            </tr>
                          </table>
                        </td>
                        <td style="font-size: 0; line-height: 0;" width="20">
                          &nbsp;
                        </td>
                        <td width="260" valign="top">
                          <table border="0" cellpadding="0" cellspacing="0" width="100%">
                            <tr>
                              <td>
                                <img src="img/technology-1940695_1920.jpg" alt="" width="100%" height="140" style="display: block;" />
                              </td>
                            </tr>
                            <tr>
                              <td style="padding: 10px 0 0 0; font-family:lato;line-height: 140%;">
                                <h4>Application</h4>
                                <a href="http://www.google.com">
                                  <button style="margin:10px 0 0 50px;color: black;padding: 15px 32px;text-align: center;text-decoration: none;display: inline-block;
    font-size: 16px; background-color: Transparent;
    background-repeat:no-repeat;
    border: 1px solid black;
    cursor:pointer;overflow: hidden;outline:none;">
																		GET THE APP
																	</button>
                                </a>
                              </td>
                            </tr>
                          </table>
                        </td>
                      </tr>
                    </table>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
          <tr>
            <td bgcolor="#363940" style="padding: 30px 30px 30px 30px;">
              <table border="0" cellpadding="0" cellspacing="0" width="100%">
                <tr>
                  <td width="90%" style="font-family:lato; color:#ffffff;">
                    &reg; Copyright &copy; 2017 <br />
                  </td>
                  <td align="right">
                    <table border="0" cellpadding="0" cellspacing="0">
                      <tr>
                        <td style="font-size: 0; line-height: 0;" width="20">&nbsp;</td>
                        <td>
                          <a href="http://www.facebook.com/">
                            <img src="img/fb.gif" alt="Facebook" width="38" height="38" style="display: block;" border="0" />
                          </a>
                        </td>
                      </tr>
                    </table>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
</body>

</html>

关于html - 验证服务 - 电子邮件消息验证失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43877482/

相关文章:

xhtml - 只有一个子元素的列表真的是一个列表吗?这是错误的语义吗?

css - 如何消除 IE6 中的意外间距?

html - 格式化表格中的数据

html - 奇怪的图片在 html 网站上移动

css - 如果用户在 div 外部单击,我们如何更改状态

悬停时的 CSS 样式

html - XHTML 和 HTML 之间的主要区别是什么?

javascript - float :left shifting next rows div block to left position when expanded

html - 如何在旋转图像下方显示文字

css - 骨架 css 列