Reputation: 127
<img src="D:/xampp/htdocs/image_app/images/cardekho-pdf-logo.png" width="400" height="400">
I am using following code but the image is not displaying. Please tell me what wrong with source code
Upvotes: 1
Views: 93
Reputation: 2755
Buddy.? If u are using XAMPP why don't you try like
http://localhost/images/cardekho-pdf-logo.png
instead of
D:/xampp/htdocs/image_app/images/cardekho-pdf-logo.png
Try like
<img src="http://localhost/images/cardekho-pdf-logo.png" width="400" height="400" alt="pdf-logo">
Upvotes: 1
Reputation: 33
<img src="D:/xampp/htdocs/image_app/images/cardekho-pdf-logo.png" width="400" height="400" />
/root_project_folder/images
Doing this will allow you to use a relative path instead of a absolute path.
Upvotes: 0
Reputation: 693
These are likely cause of the image not displaying
Upvotes: 0
Reputation: 381
You are using an image link on your local computer, if people will view your website.. the browser will try to locate the image on your visitors local computer.
Example. Juan create an image link pointing to his D: drive and uploaded the html to the internet. Juan can see the image since it is on his D: drive but Pedro can't see it. Pedro may even have no D: drive and if he have, the file cardekho-pdf-logo.png wont be even there.
To fix your issue since you are running XAMP. Load it from root folder or from HTDOCS
<img src="/image_app/images/cardekho-pdf-logo.png" width="400" height="400">
Upvotes: 0
Reputation: 3429
try this one:
<img src="../xampp/htdocs/image_app/images/cardekho-pdf-logo.png" width="400" height="400" alt="pdf-logo">
Upvotes: 0
Reputation: 1273
This is a windows link. Try hosting your image online, or use file://D:/xampp/htdocs/image_app/images/cardekho-pdf-logo.png
but it'll be only available for you
Upvotes: 0