Hacker News new | ask | show | jobs
by chrisco255 1325 days ago
That second link from W3C gives this very example:

https://w3c.github.io/aria/#example-13

"In the following code sample, the containing img and is appropriately labeled by the caption paragraph. In this example the img element can be marked as presentation because the role and the text alternatives are provided by the containing element."

<img src="example.png" role="presentation" alt="">

So empty alt tags are not discouraged.

1 comments

Hence the generally discouraged - as in not recommended in the majority of situations but exceptions exist (such as the one you provided).