aria-* 属性无效或拼写错误
aria-* attributes are not valid or misspelled
我通常在 Chrome 审核中使用 Lighthouse 测试网站的可访问性。
我偶然发现了这个警告:
aria-* attributes are not valid or misspelled.
这是失败的元素:
<a class="issue-title muted-link" href="#" data-bi-name="issue-expander" aria-role="button" aria-expanded="false" aria-controls="issue-26732-body issue-26732-comments issue-26732-reactions issue-26732-reactions-menu" aria-label="Toggle issue">
这是 link,以防有人感兴趣。
Azure load balancer Feedback Section
对我来说,aria-* 名称和值似乎是有效的。
- aria-role = "button" 似乎是正确的。
- aria-expanded = "false" 似乎是正确的。
- aria-label 似乎是正确的
- aria-controls = "..." 似乎包含一个 id 列表,所有这些 id 都存在于 DOM 中(虽然我不确定,如果它们可访问性检查应该失败DOM 中不存在并动态添加)
失败的原因是什么?
在HTML5.2.
中正确的拼写不是aria-role
而是role
. See also the ARIA Role Attribute
aria-expanded
, aria-controls
and aria-label
是正确的。
我承认错误信息本来可以更清楚,例如通过指出 aria-role
无效。
我通常在 Chrome 审核中使用 Lighthouse 测试网站的可访问性。
我偶然发现了这个警告:
aria-* attributes are not valid or misspelled.
这是失败的元素:
<a class="issue-title muted-link" href="#" data-bi-name="issue-expander" aria-role="button" aria-expanded="false" aria-controls="issue-26732-body issue-26732-comments issue-26732-reactions issue-26732-reactions-menu" aria-label="Toggle issue">
这是 link,以防有人感兴趣。 Azure load balancer Feedback Section
对我来说,aria-* 名称和值似乎是有效的。
- aria-role = "button" 似乎是正确的。
- aria-expanded = "false" 似乎是正确的。
- aria-label 似乎是正确的
- aria-controls = "..." 似乎包含一个 id 列表,所有这些 id 都存在于 DOM 中(虽然我不确定,如果它们可访问性检查应该失败DOM 中不存在并动态添加)
失败的原因是什么?
在HTML5.2.
中正确的拼写不是aria-role
而是role
. See also the ARIA Role Attribute
aria-expanded
, aria-controls
and aria-label
是正确的。
我承认错误信息本来可以更清楚,例如通过指出 aria-role
无效。