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

Ethan Hernandez
Ethan Hernandez
2,407 Points

Why do my images and links for my website only work on my computer?

  • this website is just an html file, not an actual website with a domain name
  • when i send my friends the file, the images and links don't show up/work
  • I am using atom text editor

3 Answers

You can even host your website locally over your IP. For this I use my Apache webserver at linux. On Windows you can use WAMP or for mac MAMP. This will all be done via your IP address. But hosting over your IP address is more likely for your friends. You shouldn't pass them on to everyone;) Here is an easy tutorial to host locally. https://www.wikihow.com/Host-Your-Own-Website-for-Free Otherwise you can buy a domain and upload your files via FTP.

To the links. If you are using a link from another website, you must always enter the full URL. It looks something like this. This was supposed to work. Below example links to a Google image.

<img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRqEKbScstl06-yeIMqGFFBGaY9TQVAS7NYqyUzggFsedzZyI40">

I hope I could answer all your questions. Otherwise, google will always helps.

Best regards.

Phil

Ethan Hernandez
Ethan Hernandez
2,407 Points

Thanks man, I really appreciate it

Hi Ethan,

I think you have your pictures locally on your PC. Therefore, your friends cannot access these files because they are not accessible from a server.

I hope I have been able to help you.

Ethan Hernandez
Ethan Hernandez
2,407 Points

Thanks Philipp,

So what do I need to do to make these files accessible? and how come the links don't work either?

thanks for your help

You can either send the whole folder with pictures + html page to your friends or you can host your page on a server. Which links do you mean? So what kind of links. Do they refer to other sites? It's hard to tell if you don't know the code.

If you have any further questions, please do not hesitate to ask.

Ethan Hernandez
Ethan Hernandez
2,407 Points

Okay I see,

For future reference, how do I host a page on a server?

The links I set up we're just links to images from other websites. My friend just said when he clicked the link, it wouldn't open. But when I click the links from my computer, they do open to what they are suppose to.