Alt text must not include filename

Definition The source filename of the image element must not be part of its text alternative.
Purpose
  • A text alternative should summarize the purpose of an image for people with visual impairments.
  • The source filename of the image should not be included because generally it is not useful information.
  • An image with a text alternative that is an empty string is ignored by assistive technologies, and indicates that it is being used for styling purposes rather than meaningful content.
Required Yes for HTML4 Legacy Techniques ruleset mapping
WCAG 2.0 Success Criteria

1.1.1 Non-text Content (Level A, Primary Success Criterion)

Rule Category Images
Scope Element
Target Resources img, area and [role="img"] elements
  • img
Techniques
  • A text alternative should describe the purpose of an image as succinctly as possible (preferably with no more than 100 characters). Do not include the source filename as part of the text content.
  • The alt attribute is the preferred and most commonly used way to provide a text alternative for img and area elements.
  • The aria-labelledby attribute can be used to provide a text alternative when images can be described using text already associated with the image, such as a visible caption, or for elements with role="img".
  • The aria-label attribute should only be used to provide a text alternative in the special case when an element has a role="img" attribute.
  • The title attribute will be used by assistive technologies to provide a text alternative if no other specification technique is found.
Informational Links