Add a Text Alternative to Images for Visually Impaired Accessibility
You've likely seen analtattribute on animgtag in other challenges.alttext describes the image's content and provides a text-alternative for it. Analtattribute helps in cases where the image fails to load or can't be seen by a user. Search engines also use it to understand what an image contains to include it in search results. Here's an example:
<imgsrc="importantLogo.jpeg"alt="Company logo">
People with visual impairments rely on screen readers to convert web content to an audio interface. They won't get information if it's only presented visually. For images, screen readers can access thealtattribute and read its contents to deliver key information.
Goodalttext provides the reader a brief description of the image. You should always include analtattribute on your image. Per HTML5 specification, this is now considered mandatory.
Camper Cat happens to be both a coding ninja and an actual ninja, who is building a website to share his knowledge. The profile picture he wants to use shows his skills and should be appreciated by all site visitors. Add analtattribute in theimgtag, that explains Camper Cat is doing karate. (The imagesrcdoesn't link to an actual file, so you should see thealttext in the display.)