ARIA 角色验证挑战
使用此代码:
<ul class="tabs-nav" role="tablist" >
<li role="tab"><a href="#newspane" id="tab-newnews">Latest News</a></li>
<li role="tab"><a href="#presspane" id="tab-press" >Press Releases</a></li>
</ul>
<div>
<div id="pane-newnews" role="tabpanel" aria-labelledby="tab-newnews" aria-hidden="false">
<p>Lorem</p>
</div>
<div id="pane-press" role="tabpanel" aria-labelledby="tab-press" aria-hidden="true">
<p>Ipsem</p>
</div>
</div>
我在 W3C 验证器 上收到此错误:
“属性角色的错误值选项卡列表element div”
我已经翻阅了文档中的每一块石头,没有找到任何理由这不会验证。谁能解释我做错了什么?
谢谢你!
With this code:
<ul class="tabs-nav" role="tablist" >
<li role="tab"><a href="#newspane" id="tab-newnews">Latest News</a></li>
<li role="tab"><a href="#presspane" id="tab-press" >Press Releases</a></li>
</ul>
<div>
<div id="pane-newnews" role="tabpanel" aria-labelledby="tab-newnews" aria-hidden="false">
<p>Lorem</p>
</div>
<div id="pane-press" role="tabpanel" aria-labelledby="tab-press" aria-hidden="true">
<p>Ipsem</p>
</div>
</div>
I get this error on the W3C Validator:
"Bad value tablist for attribute role on element div"
I have turned over every rock in the documentation and find no reason this would not validate. Can anyone explain what I am doing wrong?
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
W3C 验证器是一个实验性的 HTML5 检查器,ARIA 检查目前不允许 ARIA 具有里程碑意义的角色。
请参阅 Steve Faulkner 在 Paciello Group 博客上的帖子
The W3C Validator is experimental a HTML5 checker and ARIA checking does not currently allow ARIA landmark roles.
See Steve Faulkner's post over at The Paciello Group Blog
您可以使用 W3C 新标记验证服务来检查 ARIA http://validator.w3.org/nu/< /a> 但请注意,ARIA 仅适用于 HTML5,这对其是否有效没有任何影响。 ARIA 与任何风格的 (X)HTML 都能同样良好地工作,只是验证器会令人窒息。
You can use the W3C New Markup validation service to check for ARIA http://validator.w3.org/nu/ But note that ARIA is only conforming for use in HTML5, not that it makes any difference to whther it works or not. ARIA works equally well with any flavour of (X)HTML, its only the validtors that choke.