When searching the Internet for a thorough solution on available breadcrumbs, @Craig Brett's solution seemed good at first glance. But after reading several sources, aria-level seems to be misused (besides the W3C validation problem, see my comment above).
Therefore, I like to suggest this approach:
<nav aria-labelledby="bc-title" role="navigation"> <h6 id="bc-title" class="vis-off">You are here:</h6> <a href="~/" aria-labelledby="bc-level-1"> <span id="bc-level-1" class="vis-off">Homepage Website-Title </span>Home </a> <a href="~/news" aria-labelledby="bc-level-2"> <span id="bc-level-2" class="vis-off">Level 2: News </span>News </a> <a href="#" aria-disabled="true">@Model.Title</a> </nav>
In this solution, we have an HTML5 sequence element ( nav ), which should have a title, and * tada *. The vis-off class means an item that is read-only from the screen. With aria-labelledby I tell the screen reader to read this headline.
Unlike Chris’s decision, either <ul> or aria-level gone.
I would somehow go to <ol> if necessary, because the elements are fine. It is better to leave it, otherwise it will be very verbose in many screen readers on each page ("List item 1 ...").
aria-level seems to be misused in the solution above in my understanding. It must be a child of a role attribute, for example fe role="list" , and this role simply means unstructured non-interactive lists.
Perhaps the role of treeitem might be more appropriate. IMHO this is overkill.
PS: I do not use the BEM notation here to shorten identifiers and classes for readability.
Volker E.
source share