HTML5 sub nav semantics

前端 未结 2 2078
情话喂你
情话喂你 2021-02-14 03:47

A quick question re: HTML5 nav, specifically that of sub navigation (from a semantic point of view).

I have

2条回答
  •  执笔经年
    2021-02-14 03:59

    This may be an old question, but there is a better answer now:

    You can label each navigation section implicitly using headings, and explicitly use WAI-ARIA attributes:

    
    ...
    
    

    For user-agents like screenreaders, they can report that as "Local pages, navigation" (although they vary in how it's reported).

    Read more on a W3C wiki page on using labelledby.

提交回复
热议问题