开发者

Proper use of ARIA heading role

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜