0
Should we stop using div tag?
In html5 we are introduced with semantic elements. As div is not a semantic element, should we stop using div tag? And use the semantic elements to divide the sections?
2 Answers
+ 13
The div element has no special meaning at all. It represents its children. It can be used with the class, lang, and title attributes to mark up semantics common to a group of consecutive elements.
~ W3C Specification
The new semantic elements (<article>, <section>) justifiably capture a lot of <div>âs territory, but <div> still has a place in the HTML5 world. You should use <div> when there is no other more semantically appropriate element that suits your purpose. Its most common use will likely be for stylistic purposes i.e., wrapping some semantically marked-up content in a CSS-styled container ;D
+ 6
Better to use semantical elements when good suited to your content, but there's a limited number of such element, and you'll probably encounter case where there's no good suited semantical element for your purpose, so you can use the generic <div> ^^