Some rules for image captions and alt text

Images are often wrapped in a figure. Figures often contain a figcaption to “represent a caption or legend describing the rest of the contents of its parentelement.” And best practices advise us to use the alt attribute on an img to “provides fallback (alternate) text to display when the image specified by the element is […]


This content originally appeared on Geoff Graham and was authored by Geoff Graham

Images are often wrapped in a figure. Figures often contain a figcaption to “represent a caption or legend describing the rest of the contents of its parent
element.” And best practices advise us to use the alt attribute on an img to “provides fallback (alternate) text to display when the image specified by the element is not loaded.”

Some things about the relationship between figcaption and alt text:

  • The alt attribute is mandatory, even if it’s empty (""). A figcaption is optional. It’s a good idea to use something like Emmet to auto-generate the tag for you as you type.
  • The text used for the alt attribute should be different from the text contained in a figcaption. It’s redundant content that is annoying to an end user who has to hear it announced twice.
  • Marking an image as decorative (alt="") is invalid when a figcaption is present. That makes a lotta sense to me, as why would you describe the image in one place if it isn’t meant to be announced?
  • Some screenreaders may announce an image with whitespace used as the alt value (alt=" "). Didn’t know that! Wish I had more ways to test that and hear how it sounds.


This content originally appeared on Geoff Graham and was authored by Geoff Graham


Print Share Comment Cite Upload Translate Updates
APA

Geoff Graham | Sciencx (2022-09-01T16:09:01+00:00) Some rules for image captions and alt text. Retrieved from https://www.scien.cx/2022/09/01/some-rules-for-image-captions-and-alt-text/

MLA
" » Some rules for image captions and alt text." Geoff Graham | Sciencx - Thursday September 1, 2022, https://www.scien.cx/2022/09/01/some-rules-for-image-captions-and-alt-text/
HARVARD
Geoff Graham | Sciencx Thursday September 1, 2022 » Some rules for image captions and alt text., viewed ,<https://www.scien.cx/2022/09/01/some-rules-for-image-captions-and-alt-text/>
VANCOUVER
Geoff Graham | Sciencx - » Some rules for image captions and alt text. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/09/01/some-rules-for-image-captions-and-alt-text/
CHICAGO
" » Some rules for image captions and alt text." Geoff Graham | Sciencx - Accessed . https://www.scien.cx/2022/09/01/some-rules-for-image-captions-and-alt-text/
IEEE
" » Some rules for image captions and alt text." Geoff Graham | Sciencx [Online]. Available: https://www.scien.cx/2022/09/01/some-rules-for-image-captions-and-alt-text/. [Accessed: ]
rf:citation
» Some rules for image captions and alt text | Geoff Graham | Sciencx | https://www.scien.cx/2022/09/01/some-rules-for-image-captions-and-alt-text/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.