• 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:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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: 67753
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>
 
The moth suit and wings road is much more exciting than taxes. Or this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic