
Originally Posted by
TechnoBear
I've had another thought about this. If I give the section a heading of "Gallery of..." or even "20 images of...", that tells everybody - screen readers and sighted users with images disabled - that the content is a series of images. If I then use alt="" and the caption in <p> tags, it should be pretty clear what's happening. I could also add a "skip images" link, to allow screen reader users to decide whether they want to listen to a series of captions or not. How does that sound?
@stevefaulkner: Thanks for the links, but HTML5 isn't an option.
The problem with your proposed solution is that when you set alt="" on an image it is no longer available to a screen reader user. They could not find it on the page unless they look at the source code.
The following examples are conforming html 4 and 5.
A suggested approach is to include a label in the alt attribute as in the example below:
Code:
<img src="clara.jpg" alt="Photo 1.">
<p>Photo 1: Clara in her bedroom, playing her 'electric' toy guitar.
She looks like a real 'Rock & Roll' girl.</p>
This provides an implicit association between the image and its caption (via the text "photo 1"). As the alt attribute is not null the presence of the image will be announced to screen reader users.
If you want to strengthen the association between the image and its caption there are a number of methods for example:
Code:
<p>
<img src="clara.jpg" alt="Photo 1.">
<span style="display:block">Clara in her bedroom, playing her 'electric' toy guitar.
She looks like a real 'Rock & Roll' girl.</span>
</p>
Wrapping the image and caption together in a p element provides a programmatic association missing in the first example.
Bookmarks