Changes in HTML 5 - <div> Tag
What's new in HTML 5
The introduction of sectioning tags in HTML 5 is intended to reduce the need to use <div> tags for sectioning purposes.
Differences between HTML 5 and earlier versions of HTML
Sections of a page should be identified with the more specific sectioning tags rather than <div> tags. Instead of using <div>s like this:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Page Title</title> </head> <body> <div class="site-heading"> <h1>My Example Site</h1> </div> <div class="site-navigation"> ... </div> <div class="content"> <div class="page-heading"> <h2>Page Heading</h2> <div class="page-navigation"> ... </div> </div> <p>This is the introduction to the article. </p> <div class="section"> <h3>Section Heading</h3> <p>This is the content of the section. </p> </div> ... additional "section"s ... <div class="footer">...</div> </div> <div class="right-side"> ... </div> </body> </html>
use this structure instead:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Page Title</title> </head> <body> <h1>My Example Site</h1> <nav> ... </nav> <article> <header> <h2>Page Heading</h2> <nav> ... </nav> </header> <p>This is the introduction to the article. </p> <section> <h3>Section Heading</h3> <p>This is the content of the section. </p> </section> ... additional <section>s ... <footer>...</footer> </article> <aside> ... </aside> </body> </html>
The following attributes should not be coded on the <div> tag because they either have been deprecated or were never officially supported:
align
The 2000-2010 Recommendations from the W3C HTML Working Group defined the HTML namespace for the div element type name along with the names of all HTML element types. In older (pre-2000) versions of HTML, element type names were not associated with a namespace.