5

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?

Ian Y.
  • 2,293
  • 6
  • 39
  • 55

1 Answers1

11

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.

Scott Martin
  • 1,260
  • 2
  • 17
  • 27
Bert
  • 350
  • 3
  • 11
  • Thanks @Evert. So if an – Ian Y. Jan 11 '13 at 02:41
  • 1
    I am aware it has been a long time since you asked (I was disposed for a while and after that forgot about this question) but I will answer now for completeness. My apologies. Yes, if you do not explicitly use role="note", ATs will (if they support it) revert to the default "complementary". The spec tells us the NAV element may contain flow-elements, so it may contain pretty much anything (except MAIN). – Bert Jun 06 '14 at 09:09