WebAIM - Web Accessibility In Mind

E-mail List Archives

Thread: H tag with image as content?

for

Number of posts in this thread: 3 (In chronological order)

From: Rick Hill
Date: Tue, Feb 12 2013 12:19PM
Subject: H tag with image as content?
No previous message | Next message →

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. Looks like I was mistaken? If the alt doesn't count as textual content, what is a the best practice technique for this?

-------------------------------------------------------------------
Rick Hill, Web CMS Administrator
University Communications, UC Davis
(530) 752-9612
http://cms.ucdavis.edu
-------------------------------------------------------------------
Web CMS assistance at = EMAIL ADDRESS REMOVED = <mailto: = EMAIL ADDRESS REMOVED = >
-------------------------------------------------------------------

From: Steve Green
Date: Tue, Feb 12 2013 12:24PM
Subject: Re: H tag with image as content?
← Previous message | Next message →

It's a bug in the tool. There's nothing wrong with that as long as the 'alt' attribute is appropriate.

Steve Green

-----Original Message-----
From: = EMAIL ADDRESS REMOVED = [mailto: = EMAIL ADDRESS REMOVED = ] On Behalf Of Rick Hill
Sent: 12 February 2013 19:20
To: WebAIM Discussion List
Subject: [WebAIM] H tag with image as content?

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. Looks like I was mistaken? If the alt doesn't count as textual content, what is a the best practice technique for this?

-------------------------------------------------------------------
Rick Hill, Web CMS Administrator
University Communications, UC Davis
(530) 752-9612
http://cms.ucdavis.edu
-------------------------------------------------------------------
Web CMS assistance at = EMAIL ADDRESS REMOVED = <mailto: = EMAIL ADDRESS REMOVED = >
-------------------------------------------------------------------

From: Jukka K. Korpela
Date: Tue, Feb 12 2013 1:29PM
Subject: Re: H tag with image as content?
← Previous message | No next message

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