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 trialStanley Nkosi
4,233 PointsGive the image tag a src attribute with a file path of" images/spain.jpg" Stanley
How do you give the image tag a src attribute with a file path of" images/spain.jpg".?
Jamie Reardon
Treehouse Project ReviewerYou are welcome, have fun coding! :)
2 Answers
Jamie Reardon
Treehouse Project ReviewerAn attribute tag needs to be within the opening tag of an element, like so:
<img src="images/spain.jpg">
Jonathan Grieve
Treehouse Moderator 91,253 PointsAn attribute is kind of like a special "setting" that you can give a HTML tag. 2 of the most common are "alt" and "src". In the main you'll use "src" for image tags and this is how you define a path.
It works like this
<img src="path/to/image.png" alt="Altternative text goes here" />
Now the type of file path used here is known as a relative file path. That means it's referring to the path from the location on of the current HTML document.
Stanley Nkosi
4,233 PointsStanley Nkosi
4,233 PointsThanks Jamie that's the best answer.