Arguably the biggest change that comes with HTML5 is the use of new tags crafted specifically for semantic markup. They were designed to explicitly define the content within them.
Header and Footer
The new <header>
and <footer>
tags are very useful in html5. Instead of creating something like <div id="header">
, you would use a header tag, adding readability and meaning to an otherwise incomprehensible jumble of divs.
Nav
Another useful tag is the <nav>
tag. This is used to define any set of navigational links you have on your page.
Example:
<header>
<h1>My Website</h1>
<nav>
<ul>
<li>Home</li>
<li>Contact</li>
</ul>
</nav>
</header>
Other Tags
<section>
defines sections of a page, can be used instead of divs.
<article>
defines a self-contained article or chunk of content on a page.
<aside>
for extra and/or related content that would go in a sidebar on a page.
<figure>
defines images that go with a particular article or section, <figcaption>
pairs a caption with the image.