我需要理解这段代码,当我把这段代码放到 W3Schools 的重新验证网站上时,它说我有 3 个错误和警告。问题出在哪里:我不明白为什么它说尚未完成。
<html>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center">
<table width="580" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="permission" align="center">
<p>You're receiving this newsletter because you have subscribed to us.</p>
<p> If you would like to submit information, email us at [email protected] with the subject line "INFORMATION".</p>
</td> </tr>
</table>
</html>
答案1
最严重的错误是没有head
、title
或body
标签。这些是您的文档有效所必需的。
HTML 文档的基础应该是:
<html>
<head>
<title>...</title>
...
</head>
<body>
...
</body>
</html>
以下是 XHTML 1.0 Strict 的“完整”基本模板,以 HTML 形式提供:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>...</title>
...
</head>
<body>
...
</body>
</html>