HTML <img src> wont load my images - html

Im at a loss with this, im creating a mobile version of my website with jquery, but my images are refusing to load with img src tag.
<img src="images/me.jpg" width="200" height="267" alt="me">
ive tried using to load my image straight from my website but they're refusing to load also, and moving the image to the same directory as the web page, but still nothing. I just get a box the size of the width and height with the alt text and an image icon in the middle.
I just don't understand whats wrong with it.
thanks in advance.

Try to work with the full path as:
<img src="http://www.yourdomain.com/images/me.jpg" width="200" height="267" alt="me">
For test purpose just open http://www.yourdomain.com/images/me.jpg and you should see the image. If it does not work, there must be a compatibility issue with your html/jquery. Just post the rest of your html file and tell us about the jquery plugin(s) you are using ...

My images were in fact corrupt or not working properly as I couldn't open them in Photoshop, I had to replace the images.

I have just had the same issue. It was capital letters in the filename. Some pictures were loading some weren't. Some pictures had uppercase .JPG file extension, and some had lowercase .jpg. My HTML code referenced all of the images using lowercase .jpg.
I'm running webserver on my Synology DS.

I just started writing html last night so this is a total noob response because i just had the same problem, but if youre on a windows computer then your slashes in the file location should be back slashes instead of forward slashes
like i said- total noob but hope it helps

Make sure that you are in the right subdomain in case you are using dev, staging etc.
I was wondering too, until I figured out that I am on the staging domain where the image does not exist.
Also make sure to clear the cache.

If you try different things and it doesn't work, just move your image file to your working folder where your HTML file is.
The following works:
<img src="me.jpg" width="200" height="267" alt="me">

Be aware if you are using thymeleaf. Then you must have source like: (It by itself go through and do not take repository paths,...).
<div id="upperPart">
<img id="foxPicture" th:src="greenfox.png" height="200" width="200" alt="Green Fox logo"/>
<a class="Mr.Fox_description">This is Mr. Fox. Currently living on pizza and lemonade. He knows 2 tricks. </a>
</div>

One other possible cause is your server has a bug which has crashed it. When that happens, it will show the same error.
If your server auto-restarts on crashes, it can be difficult to reproduce this bug to fix it.
This happened to me while using PM2 with NodeJS.

List item
Just go the image location on your drive
select the image
open it using your favourite browser
go to url bar
copy the location from the url bar
use it in img src=(paste over here)
It will look something like this
img src="file:///C:/Users/Mercy/Documents/WEB%20DEVELOPMENT/HTML5/lion.jpg" alt="Lion profile picture" height="300" width="500"

I've solved my problem by replacing src="image.jpg" with src="file:///c:\FULL_PATH\image.jpg"

Related

HTML: image doesn't display

my problem
when I use notepad++ it's fine but when I move to Vscode it won't show up in browser
I'm a newbie in this field, and this is the first time I use Vscode , please help.
<img height="300" width="100"src="mysf.jpg">
Rather than just giving the name of the image, it’s better to give the whole path of where the picture is on your device -
<img height="300" width=“100" src=“/User/…/…”>
This will help.
This has nothing to do with the grammar of the img tag, you can see my example below, it can be displayed normally, this is related to the path of the resource on your website, you should proceed in this direction
<img height="20%" width="20%"src="https://www.happycoding.today/storage/cover_images/%E6%9C%AA%E5%91%BD%E5%90%8D.jpg_1541838726jpg">
Because there is too little information on the website, here are two suggestions for you
Confirm what is the correct relative path
Instead of using relative paths, use absolute paths instead
Here are more concepts and examples of file paths, you can refer to this study

jekyll GitHub Page page is not loading assets

So close yet so far to finishing my site.
Can't for the life of me get assets to load on the web page. They work fine on the local host.
Have tried what feels like every combination of URL and baseurl.
Been working on it for the entire day and I want to tear my hair out.
Code: https://github.com/debrincat/dd_blog.git
Website: https://debrincat.github.io/dd_blog/
The images are not working as the image location is incorrect.
As in most of the places including the Error 404 page, the link is given wrong, as:
<a class="logo__link" href="deandebrincat/">Dean DeBrincat</a>
Instead you should have used,<a class="logo__link" href="/">Dean DeBrincat</a>
And for the images:Use <img src="/images/04-1.jpg" alt="Page not found"> instead of <img src="deandebrincat/images/04-1.jpg" alt="Page not found">
The issue is that the location of your images is at:
https://debrincat.github.io/dd_blog/images/p1.jpg
Where as your HTML is pointing to:
https://debrincat.github.io/dd_blog//images/p1.jpg
To fix this, in your you need to change each image to point to "images/p1.jpg" not "/p1/kitty.jpg".
When you put "/" before the link, it means an absolute path, which is the path in the highest directory of the project.
You want the relative path, so we deleted the first /.
Something wrong in html:
<img src="/images/p1.jpg" alt="Dean DeBrincat's Picture">
You can find this error by pressing F12 in the browser and clicking console

I am not able to add picture in vs code html showing error not able to resolve it but this same question working on notepad how?

I am not able to add a picture in vs code HTML showing error not able to resolve it but this same question working on notepad how?
how can I fix this and how can I add pictures to the file
<img src="./girl.jpg" alt="profile pic"/>
Please correct the image path. Use below mention method
When assets like images is placed beside of your project, you can use A relative URL like src="girl.jpg".
For more information look Absolute URLs vs relative URLs in this article.
Now, your img tag must change to this:
<img src="girl.jpg" alt="profile_pic" />

html beginner coding: image won't show up

I have just started to learn about coding today. I'm learning from a video on Skillshare, which isn't probably the best but I guess it will work for the basics. I know that I am supposed to type this: <img src="image link"> but when I do it and refresh it it doesn't show up on the webpage. If I do it on this website it works. Tips?
Thank you in advance
First advice is to clear your browser cache, then try opening the broken image in a new tab or view source and check the image link to see if you have the path to your image entered correctly. Also sometimes the extension needs to be exact on some browsers jpg or png won't work if the file is written JPG or PNG.
Maybe you could post your code on the image link but I suspect the image path is incorrect or missing. <img src = "flower.jpg"> will look for the flower.jpg file in the same folder as where your html file is being stored. Browswer will look for different locations for the flower.jpg file for these examples : <img src = "\images\flower.jpg">, <img src = "http://www.nat.com/flower.jpg">, the former it will look for a sub-directory called images from the current directory. The final example allows you to get the image file directly from a URL if you know such a file exists.
Hi as stated <img src="image link"> is not working due to several reason such as incorrect path. Normally the html will look to the direct path for html stored location to find the image.
Example will be <img src="test.png"> if file does not exist named test.png it will return broken image such as like this now back to your question you have stated that
If I do it on this website it works
this is because the website have already have a image in the server name according to your <img src="image link"> that is why it is working inside the website. Hope this explanation answered your question good luck.

Image does not load on site hosted on Github

I uploaded an image, and linked it to the html file using proper extension and proper link to the image. Even then, the image doesn't show up.
Here's a link to my website- http://valaparthvi.github.io/
And a link to my github profile- https://github.com/ValaParthvi/valaparthvi.github.io
What is going wrong here? What are possible solutions?
The source for that image includes your home directory (/home/). No one else in the world knows that. You need to provide a proper URL that a web browser can reach. The URL for that image would be //raw.githubusercontent.com/ValaParthvi/valaparthvi.github.io/master/DSC_07321.resized.png.
Understand that when you upload a website to GitHub, it stores all the files there. All the paths to those files must be reachable by someone on the internet. Hopefully I cannot access your home directory.
GitHub pages also provides more convenient, branch-agnostic URLs. For your image, it would be /DSC_07321.resized.png. The advantage of this is that the source is not defined, so it will work locally and when deployed. In both other cases, when using your home directory or when using the fullGitHub URL, you're using an absolute URL, which won't work across multiple sources.
Jamie Counsell has the answer for the image:
<img src="/DSC_07321.resized.png" />
I would also remove
img {
padding-left: 1000px;
}
And instead surround the <img src="/DSC_07321.resized.png"> with a <div> tag with text-align: right, so it'll look good on different screen sizes.
Like this:
<div style="text-align: right;">
<img src="/DSC_07321.resized.png" alt="profile picture">
</div>
Hope this helps.
Your image has the wrong src. Try this instead:
<img src="//valaparthvi.github.io/DSC_07321.resized.png">