是role =" main"必要的< main>元件? [英] Is role="main" necessary on a <main> element?

查看:145
本文介绍了是role =" main"必要的< main>元件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果定义内容主要部分的最具语义和可访问性的方式是标准< main> 元素,则使用ARIA地标似乎是多余的。是否真的需要将 role =main添加到元素中?

It seems redundant to use an ARIA landmark if the most semantic and accessible way to define the main section of your content is the standard <main> element. Is adding role="main" to the element really necessary?

推荐答案

并非所有现代浏览器都已将aria-role main 映射到< main> 元素(目前为止) Firefox 21+和Chrome 26+已映射它)。当所有浏览器都支持此功能时,属性 role =main可能会被删除,但同时最好继续使用它。

Not all modern browsers have already mapped the aria-role main to the <main> element (so far only Firefox 21+ and Chrome 26+ have mapped it). When all browser will support this feature, then the attribute role="main" could be dropped, but in the meanwhile it's better to still use it.

资料来源:

http://html5doctor.com/the-main-element/#comment-35495 (和Steve Faulkner的回答)
http://html5doctor.com/the-main-element/#comment-36407 (最后引用和回答)

http://html5doctor.com/the-main-element/#comment-35495 (and Steve Faulkner's answer) http://html5doctor.com/the-main-element/#comment-36407 (last citation and answer)

这篇关于是role =&quot; main&quot;必要的&lt; main&gt;元件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆