HTML5 tags and WAI ARIA [duplicate]

假如想象 提交于 2019-12-13 03:34:57

问题


A quick question, if I'm using within my markups 'main' am I still obligated to use 'role' attribute?

For example, should I use:

<main>

or

<main role="main">

?


回答1:


The main element has the main role by default.

You are allowed to explicitly set the role attribute with this value, but it’s not recommended:

In the majority of cases setting an ARIA role and/or aria-* attribute that matches the default implicit ARIA semantics is unnecessary and not recommended as these properties are already set by the browser.

However, user agents that don’t support HTML5 (but WAI-ARIA) might benefit from this attribute.



来源:https://stackoverflow.com/questions/24540862/html5-tags-and-wai-aria

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!