HTML <header> Tag

Definition und Verwendung

<header> Elemente stellen Behälter für einleitende Inhalte oder eine Gruppe von Navigationslinks dar.

<header> Elemente enthalten normalerweise:

  • eine oder mehrere Überschriftselemente (<h1> - <h6>)
  • Logo oder Symbol
  • Autoreninformationen

Tipp:<header> Tags werden oft verwendet, um die Kopfzeile eines Dokuments zu definieren.

Hinweis:ein HTML-Dokument mehrere <header> Elementen platziert werden. Allerdings kann<header> kann nicht in <footer>,<address> oder einem anderen <header> im Element.

Weitere Informationen:

HTML-DOM-Referenzhandbuch:Header-Objekt

Example

Example 1

The title of <article>:

<article>
  <header>
    <h1>This is the title</h1>
    <p>Published by Bill Gates</p>
    <p>Here is some additional information.</p>
  </header>
  <p>Here is the main content.... Here is the main content....</p>
</article>

Try It Yourself

Example 2

Header:

<header>
  <h1>This is the homepage title</h1>
  <p>Published by Bill Gates</p>
</header>

Try It Yourself

Global Attributes

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

event attributes

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

Default CSS Settings

Most browsers will display the following default values <header> Element:

header {
  display: block;
}

Browser Support

The numbers in the table indicate the first browser version to fully support this tag.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
5.0 9.0 4.0 5.0 11.1