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 Introduction to HTML and CSS (2016) HTML: The Structural Foundation of Web Pages and Applications Test: Creating an HTML Element

I do not understand what the src is. I thought that I knew where to put the link but I guess I do not know.

I am not sure if I am supposed to copy and paste the link somewhere else or what.

index.html
<!doctype>
<html>
  <head>
    <title>My trip to Spain</title>
  </head>
  <body>

    <img alt="A picture of me in Spain">
    Here is a picture of me in Spain last summer!
    <a>images/spain.jpg</a>

  </body>
</html>

3 Answers

Hi Elaina! An img tag accepts two attributes, the alt tag, which you've correctly added to the img tag and src, which tells the tag where it can find the image. Currently you have the file path displaying as text, wrapped in an anchor tag.

Therefore your code should look like this: <img src="images/spain.jpg" alt="A picture of me in Spain" />

In an <img> tag the src attribute specifies where the image is located. Whether it is on your local files like

<img src="images/spain.jpg" alt="A picture of me in spain">

or a site that is hosting an image like

<img src="https://images.pexels.com/photos/1388030/pexels-photo-1388030.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940" alt="A Beautiful picture of Spain">

Thank you so much! This helps a ton!