Image inserted in html does not want to appear

Asked

Viewed 12,367 times

1

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
"http://www.w3.org/TR/REC-html40/strict.dtd">
<HTML>
<HEAD> 
<TITLE>Segundo HTML</TITLE>
</HEAD>
<BODY>
<P> Uma imagem </P>     
       <img src="C:/Users/Lucas/Pictures/Ogame.jpg" width="800" height="600">
</BODY>
</HTML>

The above code is not displaying the image, when running html in the browser only the image border appears with that error icon on it.

I don’t know where I’m going wrong...

  • If you have tried the above solutions and do not solve them, try changing the file extension to PNG. <img src="C:/Users/Lucas/Pictures/Ogame.png" width="800" height="600">

2 answers

3


If you’re carrying that HTML locally, without using a server, you can just exchange the src from image to:

src="file://C:/Users/Lucas/Pictures/Ogame.jpg"

However, for security reasons, browsers will not allow this at the time you publish to a server.

So I recommend you put the image in the same directory as yours HTML or in a subdirectory and reference her from there:

src="Ogame.jpg"

1

Your file .html is in the folder Lucas?
If he’s trying to put it like that:

<img src="Pictures/Ogame.jpg" width="800" height="600">

If it doesn’t work check if the image is even .jpg or if it is of another extent as .png for example

Browser other questions tagged

You are not signed in. Login or sign up in order to post.