Meaningful image
Alt text should communicate the same essential meaning.
Learn Image Alt Text with practical HTML examples for navigation, images, alt text, media behavior, metadata, accessibility, SEO and live practice.
HTML links and media
The alt attribute is not a caption, tooltip or keyword field. It is the text alternative for an image.
Good alt text depends on context. The same image can need different alt text on different pages because the meaning can change.
If the image is decorative, use alt="" so assistive technology can skip it. If the image communicates information, write the information in plain language.
Alt text should communicate the same essential meaning.
Use alt="" when the image adds no content.
If an image is inside a link or button, alt should describe the action.
Use nearby text, captions or long explanations for charts and diagrams.
Syntax and structure
A good alt value is short, useful and relevant to the surrounding content.
<img src="audi-a3.webp" alt="Black Audi A3 S line used for manual driving lessons"> <img src="divider.svg" alt=""> <a href="/html/images.php"> <img src="lesson-icon.svg" alt="Open the HTML images lesson"> </a>
<img src="audi-a3.webp" alt="image"> <img src="audi-a3.webp" alt="car car car driving lesson best car"> <img src="divider.svg" alt="decorative red line graphic separator">
Rules that matter
Clickable and visual HTML affects how people move, scan, trust and share a page. The details are small, but the user experience impact is large.
Write what the image means in this exact page context.
Screen readers already know it is an image.
Empty alt is intentional for decorative images.
Alt text is for users first.
If the image is clickable, alt should describe the destination or action.
A caption can add visible context, but alt still needs to cover image meaning.
Production thinking
This matters because images can carry important information. Without good alt text, part of the page disappears for users who cannot see the image.
Alt text is essential for screen reader users and for situations where images fail to load.
Alt text should be reviewed with content, not left as a technical afterthought at launch time.
Search engines use alt text as image context. Natural descriptive alt text is useful; repeated keyword spam is not.
Live code lab
Edit the HTML or CSS, then use Run to refresh the preview. The preview is isolated, so links and forms stay inside this practice area.
Mini assignment
Practice assignment
Try it yourself
Self-check
Do not only read this page. Answer these questions out loud or write the answers in your own notes. If one answer feels vague, revisit the examples before moving on.