demosthenes.info

A blog by Dudley Storey on , , , , , , and anything else that strikes his fancy.

featured articles

popular favourites

Adding WAI-ARIA Landmark Roles To Web Pages For Enhanced Accessibility

Traditional enhancements to web pages for disabled users have been limited to:

While they are a good start, these practices are minimal concessions to disabled users. The recent WAI-ARIA landmark specification substantially expands and improves on these practices, providing screen readers for the blind, such as JAWS for Windows or VoiceOver for the iPhone with clear labels for each major component of a web page, allowing users to navigate your pages easily. This is primarily achieved through a new attribute, role. The video below demonstrates how landmark roles have practical purposes for disabled users:

You’ll find that some of the ways role is used overlap with existing tags: the primary difference is that in many cases role values should be used just once, to designate primary areas of the page. In time, I expect accessibility devices will use role or HTML5 tags; for now, I would still use roles on an HTML5 page. (role can equally be applied to XHTML pages, where it has even greater purpose).

There are many, many possible values for role. Here, I’ll just focus on those most applicable to the majority of web pages, via the use of “landmarks” to denote the purpose of important areas:

WAI-ARIA Landmark Roles
Landmark RoleApplicable HTML Tag(s)Use
bannerheader

Used for banner content that is primarily site-oriented, rather than being specific to a particular page. The banner may include the logo together with the page title, site search and navigation. role=”banner” should only be used on one element per page (usually at the very start).

navigationnav

Used to denote areas used for navigating the page or site.

maindiv, section, article

The primary content of the document. Should be used no more than once per page.

complementaryaside

Content related to the main content that remains meaningful even if separated from the document. (Not applicable to comments, but possibly to pull quotes or sidebars.)

contentinfofooter

Supplementary material that describes the ownership and context of main: copyright information, footnotes, and links to privacy statements, etc.

formform

Denotes a user-editable form.

search

Denotes a specialized form devoted to search. Should be applied to the form element.

There are also roles that describe document structure and other interface elements, but we’ll leave those for another time.

Roles are very easy to add to your page. For XHTML:

  1. <div id=”header” role=”banner”>

For HTML5:

  1. <header role=”banner”>

In an upcoming article, I’ll provide a complete addition of roles to an HTML page.

web developer guide

featured comment

by JoelB in Goodbye, JQuery Validation: HTML5 Form Errors With CSS3

what i'm reading

A Storm of Swords: A Song of Ice and Fire: Book Three
A Storm of Swords: A Song of Ice and Fire: Book Three

what i'm watching

Californication: The Third Season
Californication: The Third Season

what i'm playing

Mass Effect 3 Collector's Edition
Mass Effect 3 Collector's Edition

what i'm hearing

Dub FX
Dub FX

blogs

podcasts

no ads ever

This blog is free of advertising, and always will be.

creative commons licensed

The content of this blog is free to use in whatever way you wish under the Creative Commons license.