ARIA 角色验证挑战

发布于 2024-12-25 05:14:28 字数 903 浏览 4 评论 0原文

使用此代码:

<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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

客…行舟 2025-01-01 05:14:28

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

浮云落日 2025-01-01 05:14:28

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文