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

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,109 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!