How do you make a picture link?

How to make a picture link with HTML?

  • I have made a picture link with this code snip: <a href='feed.php'><img src="C:\xampp\htdocs\Project\Icons\Feed.png"/></a> But no picture appears on my page, why? (I'm currently only using my page locally!)

  • Answer:

    It's because you (are trying to) use a local file reference. Either use the relative path or <a href='feed.php'><img src="file:///C:/xampp/htdocs/Project/Icons/Feed.png"/></a> Please be aware that if you plan to use this 'online' it will fail because of the LOCAL reference. If you load the page through your webserver you should use: <a href='feed.php'><img src="/Icons/Feed.png"/></a> Or <a href='feed.php'><img src="http://yoursite.local/Icons/Feed.png"/></a> Or whatever the path to the image is. I would prefer the relative path (the first) though which enables you to move your page to another domain without your links / images breaking.

NorS at Stack Overflow Visit the source

Was this solution helpful to you?

Other answers

You can't link local files from a remote web page. This is to prevent webpages from accessing files on the end-user's computer. Change this: C:\xampp\htdocs\Project\Icons\Feed.png To this: http://yourwebsitehere.com/Project/Icons/Feed.png EDIT: Since you say its only used locally, then you need to use this instead: file:///C:/xampp/htdocs/Project/Icons/Feed.png Also, make sure the image is actually located where you think it is! Try typing file:///C:/xampp/htdocs/Project/Icons/Feed.png into your browser's address bar and see what happens.

Unsigned

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.