跟踪像素是否需要具有可访问性(WCAG 2.0)的alt属性? [英] Do tracking pixels need to have alt attributes for accessibility (WCAG 2.0)?
问题描述
我们正在运行网站并拥有第三方跟踪像素,但在我们的网站上进行webaim / WCAG 2.0扫描时,我们收到了 alt
属性错误。
我不确定是否在这种情况下跟踪像素实际上仍然需要空白 alt
属性或屏幕阅读器仍然会读取 src
?
<$ c在这种情况下,$ c> alt =是最合适的方法 - 这会告诉屏幕阅读器图像纯粹是装饰性的,应该忽略。由于跟踪像素不能可视化地传达信息,因此从这个角度来看,它们本质上是装饰性的。
如果没有ALT存在,某些屏幕阅读器将回退读取图像名称没有扩展名),而你通常不需要。
某些屏幕阅读器(JAWS)可能会忽略1x1或类似大小的小图片 - 但仍然最好将<$ c
$ b
>
>
We are running a website and have 3rd party tracking pixels, but we're receiving alt
attribute errors when doing a webaim/WCAG 2.0 scan on our site.
I'm not sure if in this situation the tracking pixels actually need to still have a blank alt
attribute or would some screen readers still read the src
?
alt=""
is the most appropriate approach in this case - this tells the screenreader that the image is purely decorative and should be ignored. Since tracking pixels do not visually convey information, they are essentially decorative from this point of view.
If no ALT is present, some screenreaders will fallback to reading the image name (without extension) instead, which you generally don't want.
Some screenreaders (JAWS) may ignore 1x1 or similarly sized small images - but still best to put alt=""
as that's the best practice.
Some references:
- WebAIM, Alternate Text, Decorative Images
- WAI tutorial on Decorative Images
- Using null alt text and no title attribute on img elements for images that AT should ignore
这篇关于跟踪像素是否需要具有可访问性(WCAG 2.0)的alt属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!