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

Karen Rae
Karen Rae
1,963 Points

Cupcakes Code Challenge 5-5

Something's supposedly not correct with my alternate text here but I can't see what ...<img src="img/featured-cupcake.jpg" alt"Avocado Chocolate Cupcake">

7 Answers

Charles Gray
Charles Gray
19,470 Points

what does the challenge ask for?

Karen Rae
Karen Rae
1,963 Points

I have correctly added an image <img src="img/featured-cupcake.jpg"> and the next step is to add the alternate text "Avocado Chocolate Cupcake" to the image tag I just added. When I add as above i get the response "Bummer! Did you add an 'alt' attribute to your image?" I have tried adding a space after the alt but then get that my alternate text isn't quite right ...

Matthew Mascioni
Matthew Mascioni
20,444 Points

Hi Karen,

Are you sure you're forming the rest of your 'img' tag properly? To define alternate text, make sure your 'img' tag is set up as follows:

<img src="path/to/img.png" alt="Alternate Text" />

In this situation, "Alternate Text" would be replaced with "Avocado Chocolate Cupcake".

Could you post the code that's giving you the error?

Karen Rae
Karen Rae
1,963 Points

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

Matthew Mascioni
Matthew Mascioni
20,444 Points

Press space four times before pasting the code :)

Matthew Mascioni
Matthew Mascioni
20,444 Points

Sorry to hear that! Could you post the code (press space four times before pasting) that's giving you an error?

Karen Rae
Karen Rae
1,963 Points

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

Matthew Mascioni
Matthew Mascioni
20,444 Points

Seems to still not be formatting properly. Could you paste the code into a Gist, and post the URL for it here?

Karen Rae
Karen Rae
1,963 Points

I had another go just typing straight into the forum but still no go? Matthew, I don't know what a Gist is!

Matthew Mascioni
Matthew Mascioni
20,444 Points

Are you sure you're pressing [Space] four times before pasting your code in? It's required, or else your code won't show up.

Karen Rae
Karen Rae
1,963 Points

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

Karen Rae
Karen Rae
1,963 Points

Yes! I'm sure!

James Barnett
James Barnett
39,199 Points

For HTML/CSS/JS an interactive code playground like codepen is a better solution for troubleshooting instead of a static file like a gist.

Karen Rae
Karen Rae
1,963 Points

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

Karen Rae
Karen Rae
1,963 Points

Humility prevails ... My young son just came home & typed in an = sign after alt ... and I'm through! Thanks everyone for your time!