Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

div versus section?

 
Ranch Hand
Posts: 82
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the difference between Div Tag and Section Tag?
 
Sheriff
Posts: 67619
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A div is a semantic-less block element.

A section is also a block element, but semantically represents a section of a document. It usually contains a header and a body at minimum.
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The <section> element is an HTML5 element that has a general semantic meaning, which is processable by screen readers, search engines, and so on. It represents a coherent group. Usually, it has a heading <h1>-<h6> element, which identifies the section.
<section>
   <h2>Similar Posts</h2>
   <article></article>
</section>

<div> doesn’t have any meaning on its own. We can give them classes or ID , but semantically we can’t add anything.
<div class="container">
   <div class="row">
       <div class="col-12 col-lg-8"></div>
       <div class="col-12 col-lg-4"></div>
   </div>
</div>
 
reply
    Bookmark Topic Watch Topic
  • New Topic