Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple aria role "navigation" and "complementary"?

Tags:

wai-aria

role

In a document, there are multiple <nav> and <aside> elements. Should I add role="navigation" on all <nav>s and role="complementary" on all <aside>s?

In other words, is it more beneficial or more redundant that there are multiple <nav role="navigation">...</nav>s and multiple <aside role="complementary">...</aside>s in a document?

like image 743
Ian Y. Avatar asked Dec 25 '12 02:12

Ian Y.


People also ask

How many ARIA roles are there?

There are four categories of ARIA roles: landmark. document. widget.

What is role complementary?

The complementary landmark role is used to designate a supporting section that relates to the main content, yet can stand alone when separated. These sections are frequently presented as sidebars or call-out boxes. If possible, use the HTML <aside> element instead.


1 Answers

According to the HTML5 spec, role="navigation" is implicit to the <nav> element, and role="complementary" is implicit to the <aside> element. As such, you do not need to add them according to the spec. The question is how many ATs actually honor the spec, so if you want to play it safe, you can add those roles, it won't hurt.

Also rememebr that some <aside> elements should however be marked as role=note.

Another thing to consider is that the HTML5 spec allows multiple seperate <ul>s to be grouped under a <nav>. I am uncertain if this implies that role="navigation" is enough on just the <nav> or that each <ul> should be marked as such. I am unable to find any information on this.

like image 146
Bert Avatar answered Sep 17 '22 12:09

Bert