When should I use <div> and when <section> ? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 2

When should I use <div> and when <section> ?

18th May 2020, 12:13 PM
DK John
DK John - avatar
1 Réponse
+ 16
D.K. John it's very simple. Section is a new HTML5 SEMANTIC element. Use it to divide your content into meaningful parts if you really want to :) You can have a page containing a news article and a comment SECTION. However you can also divide articles into SECTIONS for your own reasons. Good old DIV tags can be used instead of new block level tags to support old browsers. They are also good for all non specific purposes.
21st May 2020, 6:37 PM
Dron Solarice
Dron Solarice - avatar