HTML5 标签和 WAI ARIA [英] HTML5 tags and WAI ARIA

查看:40
本文介绍了HTML5 标签和 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">

?

推荐答案

main 元素 具有 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/or aria-* 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屋!

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