Feed on
Posts
Comments

HTML5 and Optional Alt Attribute

HTML5 currently allows the alt attribute of the image element to be optional. If an image is given alt=””, it indicates that the image is decorative and does not convey content, or that the content of the image is conveyed elsewhere, such as through an image caption or adjacent text. In HTML5, omitting the alt attribute indicates that an alternative for the image was not provided or cannot be determined. An instance where no alt attribute might be necessary is when a user uploads hundreds of photos to a photo sharing site and will not provide alternative text for each of them. Because the alt attribute is required in previous versions of HTML and XHTML, this would require the photo sharing site to give the images improper alternative text (either alt=””, which is not accurate because the image does convey content, or generic, inaccurate alternative text such as alt=”photo087″ or similar) in order to be valid HTML. In HTML5, the alt attribute may be omitted in this case, and while this does not make the image accessible, this does provide an indication that the image is not accessible and might allow screen readers to then attempt to find or present additional potentially useful information about the image (such as the image file name, results from a related image search, etc.).

Leave a Reply

MDTAP | 2301 Argonne Drive, Room T17 Baltimore, Maryland 21218| Voice: 410-554-9230 Toll Free ⁄ Voice 1-800-832-4827|Email: mdtap@mdtap.org