HTML5 <header> Tag
The <header> tag in HTML is used to define the header for a document or a section as it contains the information related to the title and heading of the related content. The <header> element is intended to usually contain the section’s heading (an h1-h6 element or an <hgroup> element), but this is not required. It can also be used to wrap a section’s table of contents, a search form, or any relevant logos. The <header> tag is a new tag in HTML5 and it is a container tag ie., it contains a starting tag, content & the end tag. There can be several <header> elements in one document. This tag cannot be placed within a <footer>, <address> or another <header> element.
Attributes: This tag supports all the global attributes in HTML.
The below examples illustrate the <header> element in HTML.
Example 1: This example illustrates the use of the <header> tag that makes the container for the head section of the document.
Example 2: In this example, we have used the <header> tag to contain the surrounding section’s heading, but not required every time.
Example 3: In this example, we have represented navigational aids by using the <header> tag.
- Google Chrome 5 and above
- Internet Explorer 9 and above
- Microsoft Edge 12 and above
- Firefox 4 and above
- Opera 11.1 and above
- Safari 5 and above
HTML is the foundation of web pages, is used for webpage development by structuring websites and web apps. You can learn HTML from the ground up by following this HTML Tutorial and HTML Examples.
Please Login to comment...