Reputation: 5010
I've this simple layout in HTML:
<body>
<div id="header">
<div id="nav"></div>
</div>
<div id="wrapper">
<div id="main"></div>
<div id="sidebar"></div>
</div>
<div id="footer"></div>
</body>
I've translated it in HTML5:
<body>
<header>
<nav></nav>
</header>
<div id="wrapper">
<section></section>
<aside></aside>
</div>
<footer></footer>
</body>
Is it correct?
And what are the benefits of using the HTML5 tags (header, section, aside, footer) instead of old divs?
Upvotes: 6
Views: 2224
Reputation: 17365
It's all about semantics.
a <div>
has no semantic meaning.
<footer>
does.
You can read more about it here: http://diveintohtml5.ep.io/semantics.html#new-elements
Upvotes: 4
Reputation: 7991
The benefits is that it becomes more readable for machines and for other programmers.
The downside is that you need to use the HTML5shiv to make it work on IE8 and below.
Upvotes: 3