Most of the individual changes are a result of larger objectives in the design of the language. These objectives primarily include:
- Encouraging semantic (meaningful) markup
- Separating design from content
- Promoting accessibility and design responsiveness
- Reducing the overlap between HTML, CSS, and JavaScript
- Supporting rich media experiences while eliminating the need for plugins such as Flash or Java
- <article>
- <aside>
- <footer>
- <header>
- <main>
- <nav>
- <section>
An article should make sense on its own and it should be possible to distribute it independently from the rest of the site.
Potential sources for the <article> element:
- Forum post.
- Blog post.
- News story.
<article> <h2>Google Chrome</h2> <p>Google Chrome is a web browser developed by Google, released in 2008. Chrome is the world's most popular web browser today!</p> </article> <article> <h2>Mozilla Firefox</h2> <p>Mozilla Firefox is an open-source web browser developed by Mozilla. Firefox has been the second most popular web browser since January, 2018.</p> </article> <article> <h2>Microsoft Edge</h2> <p>Microsoft Edge is a web browser developed by Microsoft, released in 2015. Microsoft Edge replaced Internet Explorer.</p> </article>
| <article> | Chrome | Edge | Firefox | Safari | Opera |
|---|---|---|---|---|---|
| Version | 6.0 | 9.0 | 4.0 | 5.0 | 11.1 |
article {
display: block;
}
The <aside> tag defines some content aside from the content it is placed in.
The aside content should be indirectly related to the surrounding content.
Tip: The <aside> content is often placed as a sidebar in a document.
Note: The <aside> element does not render as anything special in a browser. However, you can use CSS to style the <aside> element (see example below).
<p>My family and I visited The Epcot center this summer. The weather was nice, and Epcot was amazing! I had a great summer together with my family!</p> <aside> <h4>Epcot Center</h4> <p>Epcot is a theme park at Walt Disney World Resort featuring exciting attractions, international pavilions, award-winning fireworks and seasonal special events.</p> </aside>
| <article> | Chrome | Edge | Firefox | Safari | Opera |
|---|---|---|---|---|---|
| Version | 6.0 | 9.0 | 4.0 | 5.0 | 11.1 |
aside {
display: block;
}
The <footer> tag defines a footer for a document or section.
A <footer> element typically contains:
- Authorship Information
- Copyright Information
- Contact Information
- Sitemap
- Back to top Links
- Related Documents
<footer> <p>Author: Hege Refsnes</p> <p><a href="mailto:name@example.com">name@example.com</a></p> </footer>
| <article> | Chrome | Edge | Firefox | Safari | Opera |
|---|---|---|---|---|---|
| Version | 6.0 | 9.0 | 4.0 | 5.0 | 11.1 |
footer {
display: block;
}
The <header> element represents a container for introductory content or a set of navigational links.
A <header> element typically contains:
- One or more heading elements (<h1> ••• <h6>)
- Logo or icon
- Authorship information
<article>
<header>
<h1>A heading here</h1>
<p>Posted by John Doe</p>
<p>Some additional information here</p>
</header>
<p>Lorem Ipsum dolor set amet....</p>
</article>
| <article> | Chrome | Edge | Firefox | Safari | Opera |
|---|---|---|---|---|---|
| Version | 6.0 | 9.0 | 4.0 | 5.0 | 11.1 |
header {
display: block;
}
The <main> tag specifies the main content of a document.
The content inside the <main> element should be unique to the document. It should not contain any content that is repeated across documents such as sidebars, navigation links, copyright information, site logos, and search forms.
Note: There must not be more than one <main> element in a document. The <main> element must NOT be a descendant of an <article>, <aside>, <footer>, <header>, or <nav> element.
<main>
<h1>Most Popular Browsers</h1>
<p>Chrome, Firefox, and Edge are the most used browsers today.</p>
<article>
<h2>Google Chrome</h2>
<p>Google Chrome is a web browser developed by Google, released in 2008. Chrome is the world's most popular web browser today!</p>
</article>
<article>
<h2>Mozilla Firefox</h2>
<p>Mozilla Firefox is an open-source web browser developed by Mozilla. Firefox has been the second most popular web browser since January, 2018.</p>
</article>
<article>
<h2>Microsoft Edge</h2>
<p>Microsoft Edge is a web browser developed by Microsoft, released in 2015. Microsoft Edge replaced Internet Explorer.</p>
</article>
</main>
| <article> | Chrome | Edge | Firefox | Safari | Opera |
|---|---|---|---|---|---|
| Version | 26.0 | 12.0 | 21.0 | 7.0 | 16.0 |
main {
margin: 0;
padding: auto;
background-color: white;
}
The <nav> tag defines a set of navigation links.
Notice that NOT all links of a document should be inside a <nav> element. The <nav> element is intended only for major block of navigation links.
Browsers, such as screen readers for disabled users, can use this element to determine whether to omit the initial rendering of this content.
<nav> <a href="/html/">HTML</a> <span>|</span> <a href="/css/">CSS</a> <span>|</span> <a href="/js/">JavaScript</a> <span>|</span> <a href="/python/">Python</a> </nav>The <nav> tag defines a set of navigation links.
Notice that NOT all links of a document should be inside a <nav> element. The <nav> element is intended only for major block of navigation links.
Browsers, such as screen readers for disabled users, can use this element to determine whether to omit the initial rendering of this content.
<nav> <a href="/html/">HTML</a> <span>|</span> <a href="/css/">CSS</a> <span>|</span> <a href="/js/">JavaScript</a> <span>|</span> <a href="/python/">Python</a> </nav>
| <article> | Chrome | Edge | Firefox | Safari | Opera |
|---|---|---|---|---|---|
| Version | 5.0 | 9.0 | 4.0 | 5.0 | 11.1 |
nav {
display: block;
}
The <section> tag defines a section of a document.
<section> <h2>WWF History</h2> <p>The World Wide Fund for Nature (WWF) is an international organization working on issues regarding the conservation, research and restoration of the environment, formerly named the World Wildlife Fund. WWF was founded in 1961.</p> </section> <section> <h2>WWF's Symbol</h2> <p>The Panda has become the symbol of WWF. The well-known panda logo of WWF originated from a panda named Chi Chi that was transferred from the Beijing Zoo to the London Zoo in the same year of the establishment of WWF.</p> </section>
| <article> | Chrome | Edge | Firefox | Safari | Opera |
|---|---|---|---|---|---|
| Version | 5.0 | 9.0 | 4.0 | 5.0 | 11.5 |
section {
display: block;
}
All the tags on this list are removed in HTML5 (but can be replaced with css):
- <acronym>
- <applet>
- <basefont>
- <big>
- <center>
- <dir>
- <font>
- <frame>
- <frameset>
- <noframes>
- <strike>
- <tt>
basefont {
color: red;
}
Instead, use CSS:
big {
font-size: 30px;
}
Instead, use CSS:
center {
text-align: center;
}
Instead, use <ul>
Instead, use CSS:
font.verdana {
font-family: verdana;
}
font.courier-new {
font-family: "Courier New";
}
font.sans-serif {
font-family: "Source Sans Pro", sans-serif;
}
Not Supported anymore.
Not Supported anymore.
Not Supported anymore.
Instead, use <del> or <s>
Tip: tt means "teletype text", like monospace.
Instead, use CSS:
tt.lucida-console {
font-family: "Lucida Console", monospace;
}
Along with strongly encouraging semantic (meaningful) markup, the HTML5 specification strongly discourages non-meaningful markup — markup intended only to tell the browser how to display things. This includes things like:
- declaring fonts and text colors.
- setting text alignment or justification.
- placing borders on tables.
- defining how text wraps around images.
There are primarily two reasons to prefer this separation:
- It is easier to maintain and redesign a site if the style declarations are confined to CSS.
- Users view web content in a lot of different contexts — desktops, laptops, tablets, mobile phones, RSS readers, and many others. Styles and design decisions that make sense in one environment don’t always make sense in another. So it is much better to provide semantic information and let the content be adapted to the context.