标头元素和 WCAG 2.0 的语义

发布于 2024-11-01 01:54:21 字数 556 浏览 2 评论 0原文

我正在使用 Total Validator 和 WAVE 工具栏在网站上进行一些可访问性测试。

使用这些时,它会引发我的文档的标头结构问题,并导致指南 1.3.1 下的失败 - 以不代表内容中关系的方式使用结构标记

http://www.w3.org/TR/WCAG20-TECHS/F43.html

我一直认为页面上最重要的标题应该是 h1,并且该标题并不总是必须是页面上的第一个标题。

例如,我在网站的标头中有一个 h2,它出现在标记中的 h1 之前。然而,即使 h2 出现在 h1 之前,我也不会说它描述了该页面以及我标记为 h1 的文本。

如果我将 h2 标记为 h1,则整个网站中最重要的标题将仅与该网站相关,而不会有效地描述该页面。

我本以为这不是一个好的做法,因为各种原因,例如搜索引擎优化、可访问性(使用标题来浏览网站的辅助技术)

我非常确定这是实用主义超过验证的情况。

Am doing some accessibility testing on a site i am currently working on using Total Validator and the WAVE toolbar.

When using these it raises issues with the header structure of my documents and causes failures under Guideline 1.3.1 - Use structural markup in a way that does not represent relationships in the content

http://www.w3.org/TR/WCAG20-TECHS/F43.html

I always understood that the most important heading on the page should be the h1 and that this heading does not always have to be the first heading on the page.

So for example i have a h2 in the masthead of the site which appears before the h1 in the markup. However, even though the h2 appears prior to the h1 i would not say that it describes the page as well as the text i have marked up as a h1.

If i were to mark up the h2 as a h1 the most important heading throughout the site would only be contextual to the site and would not describe the page effectively.

I would have thought that this was not good practice for all manner of reasons e.g. SEO, Accessibility (Assistive technologies using headers to navigate through the site)

Am pretty sure that this is a case of pragmatism over validation.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

旧时浪漫 2024-11-08 01:54:21

我不清楚你实际上在那里有一个问题,但只要 h2 的内容是某物的标题,我认为你的基础相当扎实。

请记住,自动可访问性检查器通常会寻找可疑模式。他们很少能绝对确定您做错了什么,因此应该使用它们作为帮助来查找您可以手动检查的位置,以查看是否可以以更好的方式标记内容。最重要的是,请记住,最终目标是让尽可能广泛的用户群可以访问您的网站,而不是关闭自动化测试工具。

I'm not clear you actually have a question there, but provided the content of the h2 is a header to something, in my opinion you're on pretty solid ground.

Do bear in mind that automated accessibility checkers are generally looking for suspicious patterns. It's quite rare that they can be absolutely certain that you are doing something wrong, so they should be used as a helper to find places which you can inspect manually to see if you could be marking up the content in a better way. Above all, remember that the ultimate goal is to make your site accessible to the widest possible user base, not to shut up an automated testing tool.

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