Proper use of the ARIA header role

I wonder if anyone knows that aria role = heading can be used for non-text elements (for example, for images)?

For instance:

<img alt="..." role="heading" aria-level="1">

Thanks in advance.

+3
source share
1 answer

Why not just use ...

<h1><img alt="..."></h1>

... instead of this? This seems to be similar to the same features, but avoids the issue of ARIA support.

It will also be search engine friendly (SEO), as the web crawler will know that the content is used as a headline and will process it accordingly, while it is very unlikely to look at the attributes of the aria.

+4
source

Source: https://habr.com/ru/post/1788266/


All Articles