Fred Collins
Fred Collins

Reputation: 5010

HTML5 tag benefits

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

Answers (3)

Variant
Variant

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

Cin Sb Sangpi
Cin Sb Sangpi

Reputation: 683

As a newer version more easy, shorter and easy recognizable

Upvotes: 0

Brian Hoover
Brian Hoover

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

Related Questions