如果我们将页面声明为 HTML5,是否必须遵循 HTML5 页面结构?. 下面是两个示例,显示了理想的 HTML5 页面和不遵循 HTML5 结构的页面。
但是当我使用 w3c 验证器验证这两个页面时,这些页面成功地检查为 HTML5,没有错误。
前任:
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
<header>
<nav>
<ul>
<li>Your menu</li>
</ul>
</nav>
</header>
The content of the document......
<footer>
<p>Copyright 2009 Your name</p>
</footer>
</body>
</html>
我的页面:
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
<div id="header">
<div id="navigation">
<ul>
<li>Your menu</li>
</ul>
</div>
</div>
The content of the document......
<div id="footer">
<p>Copyright 2009 Your name</p>
</div>
</body>
</html>
- 如果我们将 doctype 指定为 html5,我们是否需要使网站特定于 html5/我们是否必须维护 html5 结构?
- 当我们用 HTML4 构建网站时,验证反对 HTML5 是否是个好主意
- 当我们指定 html5 时,为什么会减少这么多错误?
- 页面应该被验证到什么程度?
- html5页面如何影响SEO