Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top