2

Is there a way of indicating (for accessibility purposes) which nav menu on a page is the primary navigation?

<nav role="navigation" id="primaryNavMenu">
    <ul> ... </ul>
</nav>

<nav role="navigation" id="secondaryNavMenu">
    <ul> ... </ul>
</nav>

It would be good to be able to do something like:

<nav role="navigation primary" id="primaryNavMenu">
    <ul> ... </ul>
</nav>

But I can't see any such provision in the ARIA documentation.

unor
  • 92,415
  • 26
  • 211
  • 360
Prembo
  • 2,256
  • 2
  • 30
  • 50
  • What would you expect accessibility tools to do with the primary vs secondary information? – Alohci May 28 '13 at 16:28
  • I guess you could thow in ` – Ryan B May 28 '13 at 19:10
  • @Alohci I guess it would be useful to know which of the numerous navs is the primary one rather than having to move through each – Prembo May 29 '13 at 16:39
  • 1
    There is a method, answered here: http://stackoverflow.com/questions/6061867/html5-sub-nav-semantics/18655216#18655216 – AlastairC Sep 06 '13 at 10:14

1 Answers1

7

Technically, no. There is only the regular role="navigation". However, the HTML5 spec used to say of the nav element:

only sections that consist of primary navigation blocks are appropriate for the nav element.

It now says:

Not all groups of links on a page need to be in a nav element — the element is primarily intended for sections that consist of major navigation blocks. In particular, it is common for footers to have a short list of links to various pages of a site, such as the terms of service, the home page, and a copyright page. The footer element alone is sufficient for such cases; while a nav element can be used in such cases, it is usually unnecessary.

Reference

As such, the nav element is only really for things like primary navigation (navigating between pages on your site), and secondary navigation (navigating between sections on the current page). Therefore, if you need something to identify the primary navigation as you have too many nav elements, there is a chance you are using it incorrectly.

Of course, the spec isn’t 100% conclusive on what should and should not be a nav element. I’d suggest looking at each of your navs and considering if it is needed or not.

Ryan B
  • 3,364
  • 21
  • 35
David Storey
  • 29,166
  • 6
  • 50
  • 60
  • That's very interesting. The site that I'm having this dilemma in has a secondary menu at top of page/document containing general links such as About Us, Contact Us, Secure Login, etc. Whereas in desktop mode (the site is responsive), the primary – Prembo May 30 '13 at 03:23
  • ... that not using the a – Prembo May 30 '13 at 03:31
  • +1 - I totally agree with the last sentence. The spec never gives indication about implementation, which is left to us to be inferred and eventually best practices will set a "de facto" standard – Luca Jun 03 '13 at 15:02