简体   繁体   English

HTML5有新的标签文章,部分和旁边。我什么时候应该使用div标签?

[英]HTML5 has new tags article, section and aside. When should I use div tag?

I understand the use of article, section and aside tags on HTML5. 我理解在HTML5上使用article,section和aside标签。 In many ways, these tags seem to replace div tag we use on HTML/XHTML. 在许多方面,这些标签似乎取代了我们在HTML / XHTML上使用的div标签。 Well, div tag is continued on HTML5 too. 好吧,div标签也在HTML5上继续。 Where and when can I use div tag for more semantic markup? 我可以在何时何地使用div标签进行更多语义标记?

The <div> element has no semantic meaning whatsoever. <div>元素没有任何语义含义。 You can safely use <div> at any point where none of the semantically meaningful elements make sense. 您可以安全地在任何没有语义意义的元素有意义的地方使用<div>

A common example is a page layout wrapper <div id="wrapper"> , whose sole purpose is to provide a visual wrapper for you to apply certain styles to. 一个常见的例子是页面布局包装器<div id="wrapper"> ,其唯一目的是为您提供应用某些样式的可视包装器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM