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 trialDaniel Zimmerman
210 PointsI cannot get the photo.
Here is the code. is it wrong?
<!doctype> <html> <head> <title>My trip to Spain</title> </head> <body>
<img src="images/spain.jpg" "A picture of me in Spain">
Here is a picture of me in Spain last summer!
<a>Go back to the top of the page.</a>
</body> </html>
<!doctype>
<html>
<head>
<title>My trip to Spain</title>
</head>
<body>
<img src="images/spain.jpg" "A picture of me in Spain">
Here is a picture of me in Spain last summer!
<a>Go back to the top of the page.</a>
</body>
</html>
3 Answers
Unsubscribed User
Front End Web Development Techdegree Student 33,900 PointsYou forgot the alt attribute. :-)
Yours:
<img src="images/spain.jpg" "A picture of me in Spain">
With alt attribute:
<img src="images/spain.jpg" alt="A picture of me in Spain">
Daniel Zimmerman
210 PointsThank you Nils. I'll give that a go. Cheers!
Unsubscribed User
Front End Web Development Techdegree Student 33,900 PointsAnother thing that you should do is to wrap the text βHere is a picture of me in Spain last summer!β in an element tag.
The browser will still display the text even without tags but it has no semantic meaning at all.
You could use the paragraph tag <p> for example. That would be the easiest for the beginning.
Later if you want the text to be a caption of the image you could use the <figure> and <figcaption> elements, like this:
<figure>
<img src="image-name.jpg" alt="image description">
<figcaption>This images shows blabla...</figcaption>
</figure>
Unsubscribed User
Front End Web Development Techdegree Student 33,900 PointsUnsubscribed User
Front End Web Development Techdegree Student 33,900 PointsThats probably also why the apostrophs are automatically a little highlighted in your code by the editor...