具有相关单位以确保第 508 节/WCAG 2.0 AA 级兼容性是否重要?

Is it important to have relative units to ensure Section 508 / WCAG 2.0 Level AA compatibility?

我所有的字体大小都以像素为单位定义,例如

body {
  font-size: 14px;
}
h1 {
  font-size: 42px;
}

其中一位在线 Section 508 / WCAG 2.0 Level AA 兼容性检查员建议我将其替换为相对单位,以便通过浏览器增加字体大小的人可以访问它。这是真正需要遵循的要求吗?我怀疑是因为 none 的其他在线检查员是这样建议我的(尽管我知道并不总是可以自动测试它)。

W3C 将 "Resizing text" 列为要求之一,但它声明用户必须能够在不使用辅助技术(如屏幕放大镜程序)的情况下增加页面上文本的大小。要对此进行测试,您可以在受影响的页面上按 CTRL-+ 或 command-+,如果文本变大,则您的内容符合要求。要了解更多信息,请查看:Understanding SC 1.4.4, resize text.

据我所知,508 并没有明确要求 可以调整字体大小,但是专家明确建议 允许调整字体大小。尼尔森 says:

Let Users Control Font Size: Tiny text tyrannizes users by dramatically reducing task throughput. IE4 had a great UI that let users easily change font sizes; let's get this design back in the next generation of browsers.

在这一行中,Section 508 § 1194.21(g) 声明:

Applications shall not override user selected contrast and color selections and other individual display attributes

其中包括字体大小并与 WCAG text resize success criterion 兼容:

The author's responsibility is to create Web content that does not prevent the user agent from scaling the content effectively

只要您不禁止调整文本大小(例如使用文本图像或使用 text-resize-adjust CSS), you're good. But, at the end of the day, the use of relative font size 提供更好的调整文本大小的体验,这不仅包括字体大小,还包括换行等属性.

出于这些原因,我认为相对字体大小对于 美学 很重要,但对于 可访问性 并不重要。

"px" 单位定义为 "css pixels"。他们已经是 "relative units"

https://www.w3.org/Style/Examples/007/units.en.html

The px unit is the magic unit of CSS. It is not related to the current font and usually not relatated to physical centimeters or inches either.

因此您使用的工具不准确或已过时,因为它不再是现代浏览器的问题。

您也可以采用上面链接文档中的方法:

But for font sizes it is even better to use em. The idea is (1) to not set the font size of the BODY element (in HTML), but use the default size of the device, because that is a size that the reader can comfortably read; and (2) express font sizes of other elements in em