PF/XTech/HTML5/NormativeImageText

From W3C Wiki
< PF‎ | XTech‎ | HTML5

Normative Statements on alt Usage in the Public Working Draft of HTML5

Compiled by Steven Faulkner

What follows is a list of normative MUST statements from the HTML 5 spec in relation to what the alt attribute MUST contain, depending on the content and/or context of an image.

4.8.2.1 Requirements for providing text to act as an alternative for images

4.8.2.1.1 A link or button containing nothing but the image

"When an a element that is a hyperlink, or a button element, has no textual content but contains one or more images, the alt attributes must contain text that together convey the purpose of the link or button."

4.8.2.1.2 A phrase or paragraph with an alternative graphical representation: charts, diagrams, graphs, maps, illustrations

"The text must be given in the alt attribute, and must convey the same message as the image specified in the src attribute"

4.8.2.1.3 A short phrase or label with an alternative graphical representation: icons, logos

"In some cases, the icon is supplemental to a text label conveying the same meaning. In those cases, the alt attribute *must* be present but must be empty."

"In other cases, the icon has no text next to it describing what it means; the icon is supposed to be self-explanatory. In those cases, an equivalent textual label *must* be given in the alt attribute"

"If the logo is being used to represent the entity, e.g. as a page header, the alt attribute *must* contain the name of the entity being represented by the logo. The alt attribute *must not* contain text like the word "logo", as it is not the fact that it is a logo that is being conveyed, it's the entity itself."

4.8.2.1.4 Text that has been rendered to a graphic for typographical effect

"In such cases, the alt attribute *must* be present but *must* consist of the same text as written in the image itself."

4.8.2.1.5 A GRAPHICAL REPRESENTATION OF SOME OF THE SURROUNDING TEXT

"In many cases, the image is actually just supplementary, and its presence merely reinforces the surrounding text. In these cases, the alt attribute *must* be present but its value MUST be the empty string."

4.8.2.1.6 [http://www.w3.org/TR/2009/WD-html5-20090212/embedded-content-0.html#a-purely -decorative-image-that-doesn-t-add-any-information A purely decorative image that doesn't add any information]

"However, a decorative image that isn't discussed by the surrounding text still has some relevance can be included in a page using the img element. Such images are decorative, but still form part of the content. In these cases, the alt attribute *must* be present but its value MUST be the empty string."

4.8.2.1.7 A group of images that form a single larger picture with no links

"When a picture has been sliced into smaller image files that are then displayed together to form the complete picture again, one of the images

  • must* have its alt attribute set as per the relevant rules that would be

appropriate for the picture as a whole, and then all the remaining images

  • must* have their alt attribute set to the empty string."

4.8.2.1.8 A group of images that form a single larger picture with links

"However, if an image is indeed sliced and any of the components of the sliced picture are the sole contents of links, then one image per link must have alternative text in its alt attribute representing the purpose of the link."

4.8.2.1.9 A key part of the content

"When it is possible for detailed alternative text to be provided, for example if the image is part of a series of screenshots in a magazine review, or part of a comic strip, or is a photograph in a blog entry about that photograph, text that can serve as a substitute for the image MUST be given as the contents of the alt attribute."