<?xml version="1.0" encoding="utf-8"?>

The alt attribute

The alt attribute

The alt attribute is not a required attribute for the <img> tag, but it's very important. It provides an alternative text for the picture if the picture doesn't load for some reason.

The alt attribute is crucial for several reasons. First, it's essential for

SEO and missing it makes you fail the W3C validation test.[1] Second, it's the only way people using screen readers can know what's in that picture that they can't see.

Use this attribute every time!

Improve your UX & Product skills with interactive courses that actually work