The header element

Several new tags or elements have been added in HTML5. The header tag (<header>) is one of them. It is used as header of one or more sections or as a header of the document. HTML5 header tag should be used as a container of introductory contents like <h1> – <h6> tags, table of contents, search form, logo etc. with or without navigational links. More than, header element can be used in a HTML5 document and it is generally placed at the beginning of the document or <article> tag.

Important points need to be remembered:

1. <header> and <head> tags are completely different.
2. A <header> tag can’t be placed within <footer> or <address> tag. Also header element can’t be placed within another header element.
3. HTML5 header element is supported by latest versions of all web browsers. Internet Explorer 8 or earlier versions of Internet Explorer do not support header element.

There are few examples of HTML5 header tag given below:

Below the header tag is used as document header.

<header>
   <h1>This is the heading of the page</h1>
   With some supplementary information
</header>

Below the header element is used as article header.

<article>
   <header>
      <h1>Title of this article</h1>
      By S Ghosh
   </header>
   Contents of the article
</article>
Press CTRL+D to bookmark this page - The header element

Your comment

(required)

+ 4 = 7