...">

Benefits of HTML5 Tags

I have 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 translated it into 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 HTML5 tags (header, section, aside, footer) instead of old divs?

+6
source share
3 answers

All about semantics.

a <div> has no semantic meaning. <footer> does.

You can read more about this here: http://diveintohtml5.ep.io/semantics.html#new-elements

+4
source

The benefits are that it is becoming more readable for machines and for other programmers.

The downside is that you need to use HTML5shiv to make it work on IE8 and below.

+3
source

As a newer version, lighter, shorter and easily recognizable

0
source

Source: https://habr.com/ru/post/892440/


All Articles