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 Build a Simple Website Text Editors and HTML Creating Structure

Sheryl Wood
Sheryl Wood
1,204 Points

Problem with alt tag

Is there something wrong with this alt tag?

<img src="img/featured-cupcake.jpg" alt="Avacado Chocolate Cupcake">

6 Answers

James Barnett
James Barnett
39,199 Points

Sheryl Wood -

You misspelled Avocado as Avacado.

Sheryl Wood
Sheryl Wood
1,204 Points

Oh gosh, that's it! Thanks!!!

Hello Sheryl. I don't see any code in your post, but I am assuming you are referring to the alt tags that accompany images (and probably other objects). If so, they are there for two main reasons:

  1. It makes the images searchable by a search engine like Google.
  2. It allows people with impaired vision who use screen readers to get an idea of what the image contains.

It will not create a caption or anything detectable with your browser.

Here's an example:

<img src="file.jpg" alt="strong horse galloping in grass field">

Hope this helps!

Hello Sheryl. I don't see any code in your post, but I am assuming you are referring to the alt tags that accompany images (and probably other objects). If so, they are there for two main reasons:

  1. It makes the images searchable by a search engine like Google.
  2. It allows people with impaired vision who use screen readers to get an idea of what the image contains.

It will not create a caption or anything detectable with your browser.

Here's an example:

<img src=file.jpg" alt="strong horse galloping in grass field">

Hope this helps!

Alt attributes should be added to images like so

<img src="image1.jpg" alt="This is the alt text" >

If that doesn't help post your code so we can take a look :)

Sheryl Wood
Sheryl Wood
1,204 Points

Thanks. I think there might be a problem with one of the tests I'm taking because I can't get past adding the alt tag. I've double-checked my code and it is correct. For now I just skipped over that part and might come back to it later. Thanks for your help!

this thread was posted not long ago. Might be something to do with that?

Also, sometimes you need to refresh the page to get the editor to accept your answer, this can mean starting the challenge again which is a bit annoying.