Skip to content

Is there a place for div in html5

After introducing new elements like <article><section>, and <aside> in HTML5,  web developers might ask if the <div>  element still has a place or more practically when we should use plain simple divs.

Now that we have access to the more meaningful new semantic tags in HTML5 (header,articlesection, and footer, figure), would we still need to use a  div?

Well the answer is definitely YES.

According to W3C: “The div tag defines a division or a section in an HTML document and it can be used to group block-elements and format them with CSS”

<div> should be used when there is no other more semantically appropriate element. It will still be widely used for stylistic purposes and positioning, like a page wrapper that will wrap up the semantically marked-up content in the page.



<div id="pagewrapper" style="width: 500px; height: 300px margin: auto auto" />


<h1>Demo Page</h1>
<!-- ...remaining content... -->


  <article> </article>



<div class="section" />
<div class="article"/>

    <div class="header"/>

            Sample post




However in the below case when wrapping a new blog post, use the new article element instead. Its simply more semantic.

<h1>Sample Post</h1>
<!-- ... content ... -->

Published inHTML5Web Development

Be First to Comment

Leave a Reply

Skip to toolbar