HTML <header>
елемент представляє групу вступних або навігаційних елементів. Він може містити елементи заголовків, а також інші елементи, такі як логотип, форма пошуку та інше.
Content categories | Flow content, palpable content. |
---|---|
Permitted content | Flow content, but with no <header> or {{HTMLElement("footer")}} descendant. |
Tag omission | {{no_tag_omission}} |
Permitted parents | Any element that accepts flow content. Note that a <header> element must not be a descendant of an {{HTMLElement("address")}}, {{HTMLElement("footer")}} or another {{HTMLElement("header")}} element. |
Permitted ARIA roles | {{ARIARole("group")}}, {{ARIARole("presentation")}} |
DOM interface | {{domxref("HTMLElement")}} |
The <header>
element is not sectioning content and therefore does not introduce a new section in the outline. That said, a header
element is intended to usually contain the surrounding section
's heading (an h1
–h6
element), but this is not required.
This element only includes the global attributes.
<header> <h1>Main Page Title</h1> <img src="mdn-logo-sm.png" alt="MDN logo"> </header>
Specification | Status | Comment |
---|---|---|
{{SpecName('HTML WHATWG', 'semantics.html#the-header-element', '<header>')}} | {{Spec2('HTML WHATWG')}} | |
{{SpecName('HTML5 W3C', 'sections.html#the-header-element', '<header>')}} | {{Spec2('HTML5 W3C')}} |
{{CompatibilityTable}}
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support | 5 | {{CompatVersionUnknown}} | {{CompatGeckoDesktop("2.0")}} | 9.0 | 11.10 | 4.1 |
Feature | Android | Edge | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | 2.2 | {{CompatVersionUnknown}} | {{CompatGeckoMobile("2.0")}} | 9.0 | 11.0 | 5.0 |