WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: IMG with a caption?

for

From: Michael Moore
Date: Mar 3, 2005 4:04PM


not sure if anyone has suggested this solution yet, sorry if it is a repeat.



Caption text here


By placing everything within an the enclosing div and setting its width
the caption will be displayed below the image because its width is the
same as the div. The alt could be "" if the caption is an appropriate
description or it could be something complementary. It should not be a
duplicate. In the example above a screen reader would read the alt first
then the caption.

Mike

christian.bradford wrote:
> Would encapsulation in a definition list, with the img in the and
> the caption in the , be considered an acceptably accessible
> solution? This may only make sense semantically if you have multiple
> (rather, a list of) images. The list would need to be styled as well
> to achieve the layout desired.
>
> christian
>
> On Thu, 03 Mar 2005 21:12:20 +0000, lists38 wrote:
>
>>glenda wrote:
>>
>>
>>>I having a brain freeze -- is there a way to add a caption under an img??
>>>Yes, it would be in addition to an ALT. Just need a quick way to add a
>>>brief description for sighted users.
>>>
>>>
>>>
>>
>>There is no HTML element or attribute for that, that would make a
>>connection between the image and the caption. The caption element is for
>>tables exclusively.
>>
>>One option would be to nest the image in the same paragraph, at least
>>then it has the same element. Setting the image display to block in
>>the CSS will show it above the text.
>>
>>----
>>To subscribe or unsubscribe, visit http://www.webaim.org/discussion/
>>
>>
>
>
> ----
> To subscribe or unsubscribe, visit http://www.webaim.org/discussion/
>
>
>
>