HTML Tag Reference - HTML tag <header>








The header element marks the header of a section. The header element cannot be a descendent of the address or footer element.

Browser compatibility

<header> Yes 9.0 Yes Yes Yes

What's new in HTML5

The <header> tag is new in HTML5.

Global Attributes

The <header> tag supports the Global Attributes in HTML.

Event Attributes

The <header> tag supports the Event Attributes in HTML.





Default CSS Settings

header { 
    display: block;
}

Example

A demo showing how to use <header> tag.

<!DOCTYPE HTML> 
<html> 
<body> 
    <header> 
        <hgroup> 
            <h1>H1</h1> 
            <h2>H2</h2> 
        </hgroup> 
    </header> 
    <section> 
        <header> 
            <h1>H1</h1> 
        </header> 
    </section> 
</body> <!-- ww w .  j  a va2 s.c o  m-->
</html>

Click to view the demo