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

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 91,252 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 :)