Image won't load on the web page(tribute page)

Image won't load on the web page(tribute page)
0
<!DOCTYPE html>
<html>
    
    
    <div id="main">
            <title>Dr. Norman Borlaug</title>

    </div>
    <body>
        <h1 id="title">Dr. Norman Borlaug</h1>
        <div id="img-div">
            <img 
            src="http:\\localhost\imgages\norman.png" alt="A man holding a crop"/>
            

        </div>

    </body>
</html>

Hi, did You try to put the image to another host and with different file extension (just compress the image to .jpg)? I guess there is a problem: file extension.

1 Like

sorry it is meant to be jpg, I was trying other extension. using jpg doesn’t work either.

Where are you running your code? Locally or on Code Pen. If you are running locally its best to just add the directory of the file and for Code pen I would just host those images somewhere and use the url as the source.

Say if you have all your images in an image folder within you project you should just put

/*Local setup*/
<img src="./images/norman.png" alt="whatever your alt text is" />

/*Code Pen Setup*/
<img src="Your URL for the Image" alt="whatever your alt text is" />
1 Like

Thanks, found my fault; the picture could not even be opened on my laptop. so tried using another picture and it worked. By the way I am doing it locally.

Glad to hear you got it to work. :slightly_smiling_face:
When adding an image or something locally just omit the localhost and just add the destination of the image.

src='./image/norman.png' or whatever your image is titled.

when you submit your project does it turn green on the curriculum?