The CSS “content” property accepts alternative text | Stefan Judis Web Development

January 29, 2024

Developers often use before and after pseudo-elements (generated content) to style elements. With a few lines of extra CSS, it is possible to include icons, images, or even add text without adjusting the HTML.Unfortunately, using content in pseudo-elements can cause accessibility issues. Just because your generated content isn’t defined in HTML, it doesn’t mean that it is not picked up by assistive technology like screen readers.

Source: The CSS “content” property accepts alternative text | Stefan Judis Web Development

Stefan Judis updates an older article on the accessibility of CSS generated content from a few years back, with news that Safari now supports generated alternative text with the CSS content property (and issues raised about the effectiveness of this technique).
Still waiting on Firefox support.