Skip to content

Commit 74c54f7

Browse files
Fix header semantics (mdn#40243)
* docs(html): Clarify header element semantics * docs(html): Clarify header element semantics - part 2 with accessibility * reverted to old wordings * Reset back to original content * Update index.md * Update files/en-us/web/html/reference/elements/header/index.md * Update files/en-us/web/html/reference/elements/header/index.md --------- Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
1 parent 6d4ac4a commit 74c54f7

File tree

1 file changed

+5
-5
lines changed
  • files/en-us/web/html/reference/elements/header

1 file changed

+5
-5
lines changed

files/en-us/web/html/reference/elements/header/index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,9 @@ header > time {
5353

5454
## Usage notes
5555

56-
The `<header>` element has an identical meaning to the site-wide [`banner`](/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/banner_role) landmark role, unless nested within sectioning content. Then, the `<header>` element is not a landmark.
56+
When not nested within [sectioning content](/en-US/docs/Web/HTML/Guides/Content_categories#sectioning_content), {{htmlelement("main")}}, or an element with the same ARIA role as these elements' implicit ARIA role, then the `<header>` element has an identical meaning to the site-wide [`banner`](/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/banner_role) landmark role. It define a global site header, which usually includes a logo, company name, search feature, and possibly the global navigation or a slogan. It is generally located at the top of the page.
5757

58-
The `<header>` element can define a global site header, described as a `banner` in the accessibility tree. It usually includes a logo, company name, search feature, and possibly the global navigation or a slogan. It is generally located at the top of the page.
59-
60-
Otherwise, it is a `section` in the accessibility tree, and usually contains the surrounding section's heading (an `h1``h6` element) and optional subheading, but this is **not** required.
58+
Otherwise, when nested within said elements, it loses its landmark status and represents a group of introductory or navigational aids for the surrounding section. It usually contains the surrounding section's heading (an `h1``h6` element) and optional subheading, but this is **not** required.
6159

6260
### Historical Usage
6361

@@ -69,7 +67,9 @@ This element only includes the [global attributes](/en-US/docs/Web/HTML/Referenc
6967

7068
## Accessibility
7169

72-
The `<header>` element defines a [`banner`](/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/banner_role) landmark when its context is the {{HTMLElement('body')}} element. The HTML header element is not considered a banner landmark when it is descendant of an {{HTMLElement('article')}}, {{HTMLElement('aside')}}, {{HTMLElement('main')}}, {{HTMLElement('nav')}}, or {{HTMLElement('section')}} element.
70+
The `<header>` element defines a [`banner`](/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/banner_role) landmark when its context is the {{HTMLElement('body')}} element.
71+
72+
When placed inside an {{HTMLElement('article')}}, {{HTMLElement('main')}}, {{HTMLElement('section')}}, {{HTMLElement('nav')}}, {{HTMLElement('aside')}}, or an element with the same ARIA role as these elements' implicit ARIA role, the `<header>` element has the [`generic`](/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/generic_role) role instead, and is no longer considered a landmark. In this case, it cannot be labeled with [`aria-label`](/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-label) or [`aria-labelledby`](/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-labelledby).
7373

7474
## Examples
7575

0 commit comments

Comments
 (0)