Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML HTML Basics Images, Text and Links Captioning Images

Noah Fields
Noah Fields
13,985 Points

How to check alt text?

When you set up alt text for an image in HTML, if everything is working properly, you won't actually get to see it. However, this means that it's hard to check and make sure that it's actually there at all. So far, I've gone to the image tag's src, changed it to something that doesn't exist, and reloaded the page - since the link is now broken the alt text is shown, so I can make sure it's there and says what I want it to say. However, having to go into my HTML file and intentionally mess it up just to make sure alt text is there is pretty silly - are there any other ways of checking the alt text to ensure it's working as intended?

1 Answer

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 90,845 Points

Hi Noah,

There's a number of ways I can think of.

You can check the source code directly using your browser. Depending on your browser you can probably do this using "View" ----> "View Source Code" which will bring up a page that displays the source code for that page, including your image and alt text.

My next tip will involve using Google Chrome. You can download a Google Chrome extension called "Web Developer" that will allow you to isolate images and the alt text that is used. You can download the extension here. I highly recommend you check it out. http://chrispederick.com/work/web-developer/chrome/ (don't worry about the red message. Just download version 0.5 :)

Secondly if you want to see a tooltip but don't see it, try adding the title attribute in just the same way as alt.

Good luck :)