Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML <img src> wont load my images

Tags:

html

image

src

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.

like image 539
Hopeless Avatar asked Nov 17 '13 17:11

Hopeless


People also ask

Why is my IMG not loading in HTML?

There are several possible reasons why your images are not showing up on your pages as expected: The image file is not located in the same location that is specified in your IMG tag. The image does not have the same file name as specified in your IMG tag. The image file is corrupt or damaged.

Why is my img src not working?

Img src Not Working That means, when a web page loads, the browser has to retrieve the image from a web server and display it on the page. The broken link icon means that the browser could not find the image. If you've just added the image, then check that you included the correct image URL in the source attribute.


4 Answers

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 ...

like image 122
Marcel Avatar answered Oct 01 '22 10:10

Marcel


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

like image 21
Hopeless Avatar answered Oct 01 '22 09:10

Hopeless


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.

like image 37
The Bisto Kid Avatar answered Oct 01 '22 10:10

The Bisto Kid


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

like image 42
P1sces Avatar answered Oct 01 '22 11:10

P1sces