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 insert images?

I created a folder in my desktop named img.I inserted a file named logo.gif,then I typed on my editor this<img search="img/logo.gif" alt="Smells Like Bakin"> but it doesn't work. What can I do?

3 Answers

Kevin Korte
Kevin Korte
28,148 Points

A big problem many people have is getting the correct source path, whether it be an absolute link path, or a relative link path. I try to use the relative link path as often as possible.

If you html file is just outside your img folder, with your image inside that, you could have a relative link path that might look like

<img src="img/logo.gif">

An absolute path on your computer might look like:

<img src="C:\Users\myuser\Desktop\img\logo.gif">

as an example of a PC desktop. This is very specific to your machine and folder structure, so it's more prone to break the image path.

you can do that by this code

<img src="img/logo.gif" alt="My Website Logo"/>

Thank you very much people!