WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: H tag with image as content?

for

From: Jukka K. Korpela
Date: Feb 12, 2013 1:29PM


2013-02-12 21:19, Rick Hill wrote:

> Seems like many/most of the accessibility tools flag a Heading tag
> that contains ONLY and image with no test content as having no
> content:
>
> <h1> <a href="index.html"> <img alt="Image text" src="image.gif" />
> </a> </h1>
>
> I thought the alt attribute would count as content.

It should count as content, so the tools are wrong.

However, when IE has been configured not to display images, it shows the
alt text in a system-defined font (tiny size), independently of
surrounding markup and CSS settings. Thus, it won't look like a heading.
But from an accessibility point of view, this is not very serious.

The markup is odd in another sense. Why is the content of the main
heading a link? This can be confusing, so it could be a problem
especially to people with cognitive difficulties.

Yucca