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 Introduction to HTML and CSS HTML: The Structural Foundation of Web Pages and Applications Paragraph Tags

Stanley Nkosi
Stanley Nkosi
4,233 Points

Give 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".?

Stanley Nkosi
Stanley Nkosi
4,233 Points

Thanks Jamie that's the best answer.

2 Answers

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 90,705 Points

An 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.