DEV 1.10 – Provide native HTML 5 for elements and ARIA for landmarks
Why is this important?
Native HTML tags (for example, headings and links) are used to identify the purpose of different elements on the page and navigate between them easily. The Web Accessibility Initiative's Accessible Rich Internet Applications (ARIA) framework provides a more extensive vocabulary for developers through the use of 'landmarks' that describe the purpose of elements on the page.
Both HTML elements and ARIA landmarks allow a developer to define, for example, where the navigation bar is on the page, or where the main content of the page starts. With these defined, assistive technologies are able to communicate the purpose of the sections to the users, and users may use navigational aids to move directly to those areas of the page.
Best practice is to use both HTML elements and ARIA landmarks to define elements.
Use accurate, semantic HTML
- Where possible, ensure that everything that looks like a heading is coded as a heading in native HTML. The same applies to buttons, links inputs, and any other element that can be represented by native HTML. Native HTML elements work ‘out of the box’.
- ARIA role assignments may be used in cases where this is not possible, for example, for custom elements or in legacy code. Unlike native HTML elements, custom widgets with assigned roles also need additional code to determine their behaviour and make them accessible, for example, to receive focus and to be activated by pressing enter/return.
HTML5 sectioning elements provide ARIA landmarks for key elements
HTML5 introduced sectioning elements that provide ARIA landmarks by default, allowing their semantics to be conveyed without specifying an ARIA role.
Table 1 – HTML5 sectioning elements and their default ARIA landmark roles
Default ARIA landmark role
banner (when used as a top-level element)
contentinfo (when used as a top-level element)
Provide both HTML elements and ARIA landmarks for key navigational elements
The most robust approach is to use both HTML5 elements and ARIA landmarks on navigational elements, to ensure compatibility with all assistive technology.
Use aria-label/aria-labelledby to add further meaning to landmarks
Label landmarks to provide extra meaning to their contents. This can be particularly useful if you have more than one landmark of the same type.
Provide heading elements at the beginning of each section of content
Make sure you use sub-level headings (h2-h6) as appropriate, to denote content blocks that come under landmark sections.
<nav role="navigation" aria-label="Main menu">
<li>Main website navigation</li>
<div>Main page content goes here</div>
<nav role="navigation" aria-label="In this section">
<div>Privacy statement, copyright</div>
Note the use of aria-label to differentiate the two navigation elements.
Examples of good practice
EN 301 549 v 2.1.2
- 184.108.40.206 Info and Relationships
- 220.127.116.11 Bypass Blocks