Skip to content
Related Articles

Related Articles

Improve Article

How to define header for a document or section using HTML ?

  • Last Updated : 26 Nov, 2020

The <header> tag in HTML is used to define the header for a document or a section. It contains 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.

The <header> element 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 requires a starting tag as well as an end tag.

There can be several <header> elements in one document.

A <header> tag cannot be placed within a <footer>, <address> or another <header> element.


<header> Contents... </header>



<!DOCTYPE html>
        How to define a header for a document
        or section using HTML?
        h1 {
            color: green;
        body {
            text-align: center;
            How to define a header for a document
            or section using HTML?
                Algo</a> |
            <a href="">
                DS</a> |
                Languages</a> |
                Interview</a> |
            <a href="">
                Students</a> |
            <a href="">
                Gate</a> |
                CS Subjects</a> |
            <a href="">


Attention reader! Don’t stop learning now. Get hold of all the important Comcompetitivepetitve Programming concepts with the Web Design for Beginners | HTML  course.

My Personal Notes arrow_drop_up
Recommended Articles
Page :