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 How to Make a Website Creating HTML Content Build the Footer

Zoe Zuniga
Zoe Zuniga
5,766 Points

img src="img/nameofimage.jpg"

I was not able to make the img src="img/nameofimage.jpg"work and went to dreamweaver and then w3 school

they have no / just <img src"nameof.jpg" alt""> no extra img/before the name of the image.

4 Answers

Wolfgang Criollo
Wolfgang Criollo
1,776 Points

src="img/nameofimage.jpg" this is looking into a folder with the name img that has an image named nameofimage.jpg when you have ( / ) you are looking inside a directory a folder

if the image is in the same directory as the .html file you don't need the ( / ) it would only be src="nameofimage.jpg"

Zoe Zuniga
Zoe Zuniga
5,766 Points

Thanks!!!, I finally figured that out. I was unable to download his files and uploaded my pics right to the root folder. Now i have deposited my pics in a nice folder named img. I sort of think it would be a little easier to name the folder images or something.

Wolfgang Criollo
Wolfgang Criollo
1,776 Points

no problem, yes folders help keep things need, i usually use the img folder to keep my layout images like background images patterns, and the images folder for actual pictures and images that are part of the content. but everyone has different preferences you know whatever works best for you

Zoe Zuniga
Zoe Zuniga
5,766 Points

Sounds good thanks again!