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?
There are four categories of ARIA roles: landmark. document. widget.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With