html - 如何修复 "The aria-labelledby attribute must point to an element in the same document"错误?

标签 html w3c-validation

我在通过 W3C 验证器验证我的网页时遇到了这个错误,我不知道如何解决这个错误。在我的 HTML 中,我在多个 s 中使用过它。下面是一个例子

<div class="modal fade in" id="undelivered-item-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" style="display: block;">

请指导我如何解决这个问题,因为我是 HTML5 的新手。

最佳答案

错误消息表明您缺少一个带有 id="myModalLabel" 的元素。

此元素必须包含 div 元素的标签。

如果你没有标签作为可见文本,你应该使用 aria-label相反。

关于html - 如何修复 "The aria-labelledby attribute must point to an element in the same document"错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39831658/

相关文章:

javascript - AngularJS 为输入类型文件添加更多选项

html - Dublin Core 和 Metaname 在 HTML5 页面中导致 W3C 验证问题

Asp.net 链接运行服务器 w3c 验证器

html - "The language attribute on the script element is obsolete. You can safely omit it."?

html - 对于没有相关替代文字的图像,是否有符合规范的做法?

javascript - 如何将选择选项中的数据添加到最后选择的文本区域?

javascript - Angular 6 集成现有的 html 模板

html - 垂直对齐中间表格单元格响应文本

html - 手写笔:@media screen and (max-width: 425px) 阻止手写笔创建 css

html - 超链接中的 & 号导致 W3C 验证失败