I wonder if anyone knows if the aria role=heading can be used for non-text elements (such as images) as well?
For example:
<img alt="..." role="heading" aria-level="1">
Thanks in adva开发者_如何学编程nce.
Why not just use...
<h1><img alt="..."></h1>
...instead? This would seem to have the same functionality, but avoids the issue of whether ARIA is even supported.
This would also be search-engine (SEO) friendly, in that a web crawler will know that the contents of the is being used as a heading and will treat it accordingly, while it is very unlikely to look at the aria attributes.
精彩评论