我试图找出一种忽略装饰性文字的方式,类似于忽略使用空的alt
装饰性图像。如何忽略可访问性原因的装饰性文字
实施例:
<!-- This is decorative image -->
<img src="example.jpg" alt="">
<!-- This should be decorative text or element -->
<div>
Some decorative text line
<div>
Another decorative text line
</div>
</div>
CSS是无用的。
aria-hidden
是 - “表示该元素及其所有的后代是不可见或可感知到由作者实施的任何用户” - 所以它不是一个选项。
[有没有写屏幕阅读器会忽略的内容的方法?](https://stackoverflow.com/questions/672156/is-there-a-way-to-write-content-that- screen-readers-will-ignore) – Anodyne
@Anodyne不,没有答案,但是谢谢。 – lessismore