Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. In many ways, these tags seem to replace div tag we use on HTML/XHTML. Well, div tag is continued on HTML5 too. Where and when can I use div tag for more semantic markup?

like image 566
chhantyal Avatar asked Dec 31 '25 05:12

chhantyal


1 Answers

The <div> element has no semantic meaning whatsoever. You can safely use <div> at any point where none of the semantically meaningful elements make sense.

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.

like image 186
BoltClock Avatar answered Jan 04 '26 03:01

BoltClock



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!