HTML5标签vs <div>只是为了理智?

amo*_*era 10 html html5

除了有一个更有意义的结构(即用<footer>标签包装页脚)为什么我应该在div标签上使用html5标签?

如果我使用<div>i仍然可以使用一些甜蜜的html5功能,那么为什么我要担心学习所有这些新标签?

PS:我知道视频和音频标签可以更容易地嵌入媒体

nop*_*ole 6

使用这些标签将有助于搜索引擎索引您的网站,以及屏幕阅读器等.这称为"语义正确性".

  • 搜索引擎多年来一直在处理基于表格的网站,您认为html5会对我的网站现在的索引方式产生任何影响吗?(真正的问题) (4认同)

Moa*_*oak 6

<div>This is an advertisement about big rubber flashlights</div>
<div>This is the actual content of the current page, an important article about the state of the world we live in</div>
<div>Here a user posts that he hates everything about this place</div>
Run Code Online (Sandbox Code Playgroud)

第二个div我想通过替换<article>标签会受益匪浅,因为Web机器人,小工具或浏览器可以看到这可能是页面的主要主题.


Dar*_*o Z 6

喜欢的标签footer,section等等都包含在HTML5作为迈向语义网的举动.您可以在Wikipedia上了解有关语义Web的更多信息.简而言之,语义网可以帮助搜索引擎更好地理解您网站上的内容,从而(希望)可以获得更准确的搜索排名.它还意味着程序员可以编写更准确地解析您的站点的代码,例如浏览器制造商可以在他们的浏览器中加入对网页语义做出反应的功能.