HTML5页面结构如何影响W3C验证和搜索引擎优化 [英] How HTML5 page structure affects W3C validation and SEO
本文介绍了HTML5页面结构如何影响W3C验证和搜索引擎优化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我们将页面声明为HTML5,是否必须遵循HTML5页面结构? 。
以下两个例子显示了理想的HTML5页面和不遵循HTML5结构的页面。
但是,当我使用w3c验证器验证这两个页面时,这些页面成功检查为HTML5而没有错误。
例如:
<!DOCTYPE html>
< html>
< head>
< title>文件的标题< / title>
< / head>
< body>
< header>
< nav>
< ul>
< li>您的菜单< / li>
< / ul>
< / nav>
< / header>
文件的内容......
< footer>
< p>版权所有2009您的名称< / p>
< / footer>
< / body>
< / html>
我的页面:
<!DOCTYPE html>
< html>
< head>
< title>文件的标题< / title>
< / head>
< body>
< div id =header>
< div id =navigation>
< ul>
< li>您的菜单< / li>
< / ul>
< / div>
< / div>
文件的内容......
< div id =footer>
< p>版权所有2009您的名称< / p>
< / div>
< / body>
< / html>
- 如果我们指定doctype为html5,我们需要制作网站html5
特定/我们是否必须维护html5结构? - 当我们在HTML4中构建网站
时验证再次使用HTML5是个好主意 - 当我们指定html5时为什么会有这么多的错误得到减少?
- 取决于页面的验证程度?
- html5页面影响SEO
解决方案
- 是的。但是:那些
< header>
,< nav>
etc元素不是必需的! HTML5文档即使是缺失也是有效的HTML5文档。 - 否。
- 请原谅。
- 你能举一个例子吗?如果您的意思是像
-webkit-appearance
这样的专有样式属性,那么您必须接受这些不验证的事实。 - 实际上,我不确定他们是否这样做。不过,它们可能会在将来产生影响。
If we declare page as HTML5, Is it mandatory to follow HTML5 page structure ? . Below are two examples shows the ideal HTML5 page and page which is not following HTML5 structure.
But when i validated these two pages using w3c validator, these pages successfully checked as HTML5 without errors.
ex:
<!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>
My page:
<!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>
- If we specify doctype as html5 do we need to make website html5 specific / do we have to maintain html5 structure ?
- Is it a good idea to validate againist HTML5 when we built website in HTML4
- When we specify html5 why so many errors got reduced?
- Upto what extent the page should be validated?
- How does html5 page affects the SEO
解决方案
- Yes. But: those
<header>
,<nav>
etc elements are not mandatory! A HTML5 document is a valid HTML5 document even if they are "missing". - No.
- I beg your pardon?
- Can you give an example? If you mean proprietary style properties like
-webkit-appearance
, yes, you'll have to live with the fact that those don't validate. - I'm not sure they do, actually. They may have an effect in the future though.
这篇关于HTML5页面结构如何影响W3C验证和搜索引擎优化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文