Ask coding questions

← Back to all posts
Why isn't my image loading?
GracieHorlbogen (1)

I have the image in a file, but whenever I download the image and try to put it in my code it says, "Some files may fail to load on the browser. Click here to download"

this is my code,
<img src="bubblegum(1).jpeg" height="200" width="300">

Answered by InvisibleOne (3003) [earned 5 cycles]
View Answer
InvisibleOne (3003)

Well, basically your code is messed up, you have unclosed tags and a closing head tag with no opening one. Besides that, the formatting is a bit unusual and needs to be fixed.
The problem lies in that your jpeg contains nothing, so there must have been an error when you loaded it into your repl.
Here's a fork of your site with a different image and the formating of your HTML fixed:
I don't want to sound mean by saying that and if you need any help just let me know, I'm pretty decent with HTML and CSS

InvisibleOne (3003)

Replit doesn't seem to like Jpeg files, try converting it to an jpg or png or try reading it to your project.
Note: PNG images generally resize better and look a lot nicer in web projects so you should try to stick to them

btfuss (177)

May wanna try to convert that to jpg or png. Can't help you there :/

MikeJMS8910 (231)

you didn't close the img. You need to put a </img> at the end

InvisibleOne (3003)

img tags are self closing, they don't need a closing tag. @MikeJMS8910