Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS Treehouse Club: CSS My First Web Page Changing Your HTML

What's the purpose of alt="Joy"?

What's the purpose of alt="Joy"? I can't see what it does... (I omitted it as an experiment and it didn't seem to make any difference.)

2 Answers

William Li
PLUS
William Li
Courses Plus Student 26,868 Points

Hi, Julian Williams

In HTML, the alt attribute adds text info to the image, and you're correct that visually it makes no difference because that alt text associated with the image doesn't get displayed; however, for people who are visually impaired that rely on screen reader to read the web page, alt info helps them understand what the image is all about, and generally speaking, it's recommended that you include alt attribute for images when coding a website for better accessibility.

For more info on alt attribute, check out this page.

Hope this helps, cheers.

Many thanks, William. Appreciated.