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

Jesse Bowen
Jesse Bowen
114 Points

where does the src go in an image tag ?

create an image tag

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>Go back to the top of the page.</a>

  </body>
</html>

3 Answers

Logan R
Logan R
22,989 Points

Hi!

An example would be:

<img src="image.jpg" alt="A picture of me in Spain">

Where "image.jpg" is the location of the file.

Jack Weldon
Jack Weldon
1,708 Points

The src attribute goes right after the opening tag, followed by alt and any other attributes you want to declare for the image.

<img src="placeholder.url" alt="Placeheld">
Jesse Bowen
Jesse Bowen
114 Points

Thanks guys. I figured it out by rewatching but it's great to know these questions don't go unanswered! What a helpful community!