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
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:
- How do you add a picture link your question?Best solution by Yahoo! Answers
- How to make a picture look like a drawing?Best solution by Yahoo! Answers
- How do I make a picture into a link?Best solution by Yahoo! Answers
- How to make a picture the fill of text?Best solution by Quora
- How to make a picture in my yahoo.email?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
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.