Skip to content

HTML validation error: 'Possible misuse of aria-label' in header #1340

Closed
@hannalaakso

Description

The header with navigation throws the following warning in https://validator.w3.org/:

Possible misuse of aria-label.

This relates to

<ul id="navigation" class="govuk-header__navigation {{ params.navigationClasses if params.navigationClasses }}" aria-label="Top Level Navigation">
which was inherited from govuk_template.

The WCAG specs state that aria-label can be used for:

  • Distinguishing navigation landmarks
  • Identifying region landmarks

We should review whether having aria-label in this context provides useful information for assistive technologies.

There is also a related issue where we hide the list inside the navigation element when showing/hiding the navigation. This means that a user can end up with an empty <nav></nav> element, which may cause issues/confusion for screenreader users. See comment for more context.

Done when

  • TBC
  • "Details of breaking change" section below completed to help with writing release notes

Details of breaking change

  • which users are affected: TBC
  • the change that’s been made: TBC
  • changes users will have to make: TBC
  • impact of users not making those changes: TBC

Metadata

Assignees

Type

No type

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions