W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2006

[whatwg] image captions

From: Ben Meadowcroft <ben@benmeadowcroft.com>
Date: Wed, 28 Jun 2006 21:01:34 +0100
Message-ID: <010f01c69aed$a95a9390$0202a8c0@BensPC>
> -----Original Message-----
>
> ... Snipped a bit ...
>
> > What's wrong with
> >
> > <div>
> >    <img src="">
> >    <p>This is the caption.</p>
> > </div>
> >
> 
> How about an anchor with rel="caption":
> 
> <a rel="caption" href="#caption1"><img src="x.jpg"/></a>
> <span id="caption1">man bites dog</span>
> 
> or
> 
> <img id="img1" src="x.jpg"/>
> <span id="caption1"><a rel="caption" rev="#img1">man bites 
> dog</caption></span>
> 
> The latter has the advantage that you can put another <a> 
> element around the image (HTML4 prohibits nesting iirc).
> 
> This way requires no new elements or attributes, just a new 
> LinkType[1]. Also if you define other LinkTypes, you could 
> express the other relationships Michel identified, e.g. you 
> could have a Linktype for "excerpt of an article with a> 
> small category logo at the top."

Perhaps a better method would be using the longdesc attribute to associate a
caption with an image.
Specifically we could point the image to fragment within the current page
and give an explicit association in this manner.

<img src="man.gif" alt="A Man" longdesc="#manCaption" />
<p id="manCaption">A more full description of the image</p>

Does anyone know how screenreaders and other assistive technologies handle
longdesc URIs pointing to fragments within the same page?

regards,
Ben
Received on Wednesday, 28 June 2006 13:01:34 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:28 UTC