#### 34.2.2 Using special paragraphs to assign WAI image attributes

You can designate a paragraph format whose content will be the text alternative for the next anchored frame in a flow. For example, suppose you use paragraph format Figname for this purpose:

    [HtmlStyles]
    ;  Alt makes current para content into alt attribute for next img
    Figname=Alt Delete

Somewhere just before the image you would insert a Figname paragraph containing the name you want displayed as an alternate for the graphic image. Probably you would make the Figname paragraph conditional so it would not appear in print. The Delete property would exclude the paragraph (as such) from HTML output; HTML source would show the text of the Figname paragraph as the value for the alt attribute of the <img> element.

For example, if you were to place a Figname paragraph with the content “Cat in basket” just before the image, in some browsers moving the pointer over the image would display this content in a tooltip. However, in most current browsers, the tooltip shows the content of the title attribute rather than the alt attribute; and the alt text is displayed only when the image is not displayed or is missing.

Previous Topic: 34.2.1 Following WAI guidelines for images

Next Topic: 34.2.3 Using a PI marker to assign WAI image attributes

Parent Topic: 34.2 Applying WAI markup to images

Sibling Topics:

34.2.1 Following WAI guidelines for images

34.2.3 Using a PI marker to assign WAI image attributes