Reputation: 93
I was editing an HTML page and had some issue in replacing image. It didn't displayed anything.
Then I tried making a simple HTML program just to test
<html>
<head>
<title>
</title>
</head>
<body>
<img src="/images/Kanhaji.jpg" alt="HTML5 Icon" width="128" height="128" />
</body>
</html>
but it still doesnot work.
I tried Everything Including but not limited to
1. Giving local links in same directory in which my page is.
2. Creating a subDirectory and giving its link.(as shown above)
3. Giving full path
4. using <image src="./Kanhaji.jpeg" />
(proper reference methods ./
../
etc)
5. Using an Online Link <image src="https://I_cannot_remember_the_url_exactly />
6. Hard Refreshing page ctrl + f5 in case if browser is using cached contents somehow.
But nothing seems to work
only a box,where image is supposed to appears, with a broken image icon appears.
<img class="rounded-circle img-fluid d-block mx-auto" src="http://placehold.it/200x200" alt="">
the above code is working fine
after watching it working , i tried to
7.remove extension of file if it is effecting somehow but that also didn't helped
Can anyone help me with this problem.
Upvotes: 0
Views: 2508
Reputation: 93
Okk guys i Think There was a problem with my browser.. when i tried this answer ... it failed to open directly as well.. i reinstalled Firefox and its working now.. but was not able to found the cause of problem
Upvotes: 0
Reputation: 188
You are missing . Before the /image. It's leads to the subfolder where your image is kept.
<img> src="./images/Kanhaji.jpg" alt="HTML5 Icon" width="128" height="128"/>
Upvotes: 0
Reputation: 106
Open your image in a browser and you can see real path in address bar, if you testing in localhost... and tell us about your path for a help you.
Upvotes: 1
Reputation: 1
The above html structure should be fine. I'd recommend checking the following:
Anyway, if you could provide the url of your site, it would be helpful.
Upvotes: 0