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

The alt attribute

The alt attribute

The alt attribute is not required for the <img> tag, but it is very important. It provides text that appears when an image does not load. The alt attribute matters for two key reasons. First, it supports SEO, and leaving it out can cause a W3C validation failure. Second, it is the only way screen reader users can understand what an image shows.

Always include the alt attribute when using images.

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