This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 22773 - Captions in image alt attributes
Summary: Captions in image alt attributes
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec (show other bugs)
Version: unspecified
Hardware: PC All
: P2 enhancement
Target Milestone: ---
Assignee: steve faulkner
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords: a11y
Depends on:
Blocks:
 
Reported: 2013-07-23 14:37 UTC by Reinier Kaper
Modified: 2013-07-24 08:46 UTC (History)
6 users (show)

See Also:


Attachments

Description Reinier Kaper 2013-07-23 14:37:52 UTC
In the following example in the draft (4.8.1.1.6), a caption is included in the image's alt attribute.

While this could be a legit use of the alt attribute, I feel it's more appropriate to store this information in a figure, with a corresponding figcaption. This way the alt attribute of the image can remain related to the images content and the figcaption would describe the purpose of the figure itself.

Thoughts?

Original:
"<p><img src="figure1.gif" alt="Figure 1. Distribution of Articles by Journal Category. 
  Pie chart: Language=68%, Education=14% and Science=18%."></p>"

Suggestion:
"<figure><img src="figure1.gif" alt="Pie chart: Language=60%, Education=14% and Science=18%."><figcaptio>Figure 1. Distribution of Articles by Journal Category.</figcaption></figure>"
Comment 1 steve faulkner 2013-07-23 14:50:27 UTC
(In reply to comment #0)
> In the following example in the draft (4.8.1.1.6), a caption is included in
> the image's alt attribute.
> 
> While this could be a legit use of the alt attribute, I feel it's more
> appropriate to store this information in a figure, with a corresponding
> figcaption. This way the alt attribute of the image can remain related to
> the images content and the figcaption would describe the purpose of the
> figure itself.
> 
> Thoughts?
> 
> Original:
> "<p><img src="figure1.gif" alt="Figure 1. Distribution of Articles by
> Journal Category. 
>   Pie chart: Language=68%, Education=14% and Science=18%."></p>"
> 
> Suggestion:
> "<figure><img src="figure1.gif" alt="Pie chart: Language=60%, Education=14%
> and Science=18%."><figcaptio>Figure 1. Distribution of Articles by Journal
> Category.</figcaption></figure>"

Hi Reiner, in this case the 'caption' text is included in the image, so the text alternative in the alt attribute is reflecting that.

as it states in the example: "Consider an image containing a pie chart and associated text. It is recommended wherever possible to provide any associated text as text, not an image of text. If this is not possible include the text in the text alternative along with the pertinent information conveyed in the image.
Comment 2 Reinier Kaper 2013-07-23 14:53:00 UTC
Ah okay I see, it's just in the case where (for some reason) you can't provide the text equivalent.

Will close this issue then ;-) Thanks!
Comment 3 dmacdona 2013-07-23 15:05:30 UTC
I think this suggestion might be a bit too perscriptive, and giving screen reader users two places to find the alt may be more steps than efficient for such a short alt..