In this article, I describe some basic tags in HTML5. These tags are the Header tag, Nav Tag, Section Tag, Aside Tag, and Footer Tag.
<Header> Tag
The <header></header> tag creates document or section headers. It can also contain <h1> to <h6> tags. It specifies a header for a document or a section. You can have several header elements in a single document.
A <header> tag cannot be placed with in a <footer>, <address> or other header elements. The <header> tag is new in HTML5.
Browser support
The <header> tag is supported by Internet Explorer 9, Firefox, Opera, Chrome and Safari.
Internet Explorer 8 and earlier versions do not support the <header> tag.
Nav Tag
The <nav> tag declares the navigational section of your web page. You can nest <nav> tags in a <header> as well as in a <footer> tag. It can be used multiple times on a single page. The Nav Tag is only present in HTML5. It is not supported in HTML4.01.
It has both start and end tags. In other words, if we want a group of related links then we will use the <nav> tag.
Browser Support
The <nav> tag is supported by Internet Explorer 9, Firefox, Opera, Chrome and Safari.
Internet Explorer 8 and earlier versions do not support the <nav> tag.
The <section> tag defines a section in a document. This tag represents the logical division of the document. This could mean product descriptions, chapters, discussions, headers, footers or any other section of the document.
The <section> tag was introduced in HTML5.
Browser Support
The <section> tag is supported by Internet Explorer 9, Firefox, Opera, Chrome and Safari.
Internet Explorer 8 and earlier versions do not support the <section> tag.
Aside Tag
The <aside> tag shows the section of the text that is related to the main content of the document. It provides additional information that can improve the article. This type of content is often represented in sidebars.
The <aside> tag is new in HTML5.
Syntax
<aside>Content of aside</aside>
Browser Support
The <aside> tag is supported by Internet Explorer 9, Firefox, Opera, Chrome and Safari.
Internet Explorer 8 and earlier versions do not support the <aside> tag.
Footer Tag
The footer tag defines a footer for the document. You can have several footer elements in one document.
Note: if you are using a footer tag for the address of the author, it must be enclosed in an address tag.
Browser Support
The <footer> tag is supported by Internet Explorer 9, Firefox, Opera, Chrome and Safari.
Internet Explorer 8 and earlier versions do not support the <footer> tag.
Coding
A complete sample, along with other tags, is shown below:
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8" />
- <title>Header Tag,Nav tag,Section Tag,Aside Tag and Footer Tag in HTML5</title>
- <link rel="stylesheet" href="main.css">
- </head>
- <body>
-
- <header>
- <h1 style="color:Red">This is the header section of the HTML5</h1>
- </header>
-
- <nav>
- <ul>
- <li>CORE JAVA</li>
- <li>ADVANCE JAVA</li>
- <li>HTML 5</li>
- <li>JAVA SCRIPT</li>
- <li>PHP</li>
- </ul>
- </nav>
-
- <section>
- <h2>HTML 5 provides section tag to add content to the main section</h2>
- </section>
-
- <aside>
- <h3>About aside tag</h3>
- Aside tag is used to post the side content for the site.
- </aside>
- <hr/>
- <footer style="color:gray">
- @Designed by Ashwani Tyagi
- </footer>
- <hr/>
- </body>
- </html>
Output