简单的 DOM/CSS 说明? [WCAG F17 1.3.1]
http://www.w3.org/TR/WCAG-TECHS/F17.html
我在理解此标准以及基于所涉及的一系列测试导致网站失败的原因方面存在一些问题。
检查 id 和 accesskey 值在文档中是否不唯一。
检查具有 idref 值的属性值是否具有相应的 id 值。
对于使用 axis 属性的表格,请检查 axis 属性中列出的所有值在同一表格的表头单元格中是否都有对应的 id 值。
对于客户端图像映射,如果 usemap 属性不是 URI,请检查 usemap 属性的值是否具有相应的 id 值。
如果步骤#1、步骤#3 或步骤#4 为真或步骤#2 为假,则此失败条件适用,并且内容不符合成功标准。
http://www.w3.org/TR/WCAG-TECHS/F17.html
I have some issues understanding the criteria of this and what makes a website fail BASED on the series of tests involved.
Check for id and accesskey values which are not unique within the document.
Check that attribute values that have an idref value have a corresponding id value.
For tables that use the axis attribute, check that all values listed in the axis attribute have a corresponding id value in a table header cell in the same table.
For client-side image maps, check that the value of the usemap attribute has a corresponding id value if the usemap attribute is not a URI.
If step #1, step #3 or step #4 is true or step #2 is false, then this failure condition applies and the content fails the success criterion.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这些是使您编写的 HTML 有效的一系列要求。
1 很简单。页面上不能有多个具有相同 ID 的元素。如果页面上有多个具有相同 ID 的元素,那么当您调用 Javascript 函数时
,您将很难选择所有这些元素。如果您希望多个项目具有相同的样式,那么您应该使用 class 属性而不是 ID。 ID必须是唯一的!
2 如果您为某个元素指定了 idref 属性,则该元素必须对应于具有您在 idref 属性中指定的 id 的现有元素。例如,如果您想使用以下 idref:
那么您的文档中的某处必须有一个现有的 id,看起来类似于:
您不能引用不存在的 id!
3 我以前从未使用过 axis 属性,但我通过阅读该文档和少量 Google 搜索了解到;如果您想使用轴属性,那么每个单元格都必须在其所在列的表标题中提供相应的轴属性。其他人可能可以对此进行扩展。
4 再说一遍,我从未使用过 ImageMap,但 W3C 文档已将这套规则归类为非唯一身份和不匹配引用的一般主题,因此我只能假设它类似于2 其中,图像映射有一个相应的使用映射,通过其 ID 引用(除非已将其指定为 URI)。
我认为本文档的主旨是强化这样一个概念:需要这些属性的元素应该始终有一个相应的属性,并且元素 ID 应始终保持唯一。
如果您尝试修复网站上的某些内容,则可以使用 http://validator.w3.org/一个非常方便的资源,用于查明页面上的错误并对其进行描述。希望这有帮助!
These are a series of requirements that make the HTML you have written valid.
1 is straightforward. There can't be more than one element on your page with the same ID. If you have multiple elements with the same ID on your page then when you call the Javascript function
then you will have trouble selecting all of them. If you want multiple items to have the same style, then you should be using the class attribute rather than ID. The ID must be unique!
2 If you have given an element the idref attribute, then it must correspond to an existing element with the id you have specified in the idref attribute. For example, if you wanted to use the following idref:
Then there must be an existing id somewhere in your document, that looks something like:
You can't reference an id that doesn't exist!
3 I have never used the axis attribute before, but what I understand from reading that document and a small amount of Googling; if you want use the axis attribute then every cell must have a corresponding axis attribute supplied in the table header of the column it is in. Someone else may be able to expand on this.
4 Again, I have never used an ImageMap, but the W3C document has categorized this set of rules under the general theme of non-unique identities and mismatched references, so I can only assume that it is similar to 2 whereby, the imagemap has a corresponding usemap, which is referenced by its ID (unless, it has been specified as a URI).
I think the gist of this document is to enforce the concept that there should always be a corresponding attribute for the elements that require them, and your element ID's should always be kept unique.
If you are trying to fix something on your website, then http://validator.w3.org/ can be a very handy resource for pinpointing errors on your page and describing them. Hope this helps!