HTML5 标签和 WAI ARIA [英] HTML5 tags and WAI ARIA
问题描述
一个简单的问题,如果我在我的标记中使用main",我是否仍然有义务使用role"属性?
A quick question, if I'm using within my markups 'main' am I still obligated to use 'role' attribute?
例如,我应该使用:
<main>
或
<main role="main">
?
推荐答案
The main
element has the main
role by default.
您可以使用此值显式设置 role
属性,但它是 不推荐:
You are allowed to explicitly set the role
attribute with this value, but it’s not recommended:
在大多数情况下,设置匹配默认隐式 ARIA 语义的 ARIA role
和/或 aria-*
属性是不必要的,不推荐,因为这些属性已经存在由浏览器设置.
In the majority of cases setting an ARIA
role
and/oraria-*
attribute that matches the default implicit ARIA semantics is unnecessary and not recommended as these properties are already set by the browser.
但是,不支持 HTML5(但支持 WAI-ARIA)的用户代理可能会受益于此属性.
However, user agents that don’t support HTML5 (but WAI-ARIA) might benefit from this attribute.
这篇关于HTML5 标签和 WAI ARIA的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!