Insert image in HTML

**when I enter the code in HTML, I get a rectangular box with the word image, but there is no image. When I try to open it, I get the message “error”

Your code so far

      <body>
<img src=/html/images/002.jpg" alt="Dolls 2020" width="200"  height="80">
</body>

</html>





<h2>CatPhotoApp</h2>
<main>


<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
</main>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36.

Challenge: Add Images to Your Website

Link to the challenge:

I believe you should have enclosed the file path for your image source with 2 quotation marks. You only have one quotation mark at the end of the image source. Also, make sure your image is at the file path that you specified. The purpose of the 'alt' is for broken image links to tell the user what the image is suppose to be. The very problem you may also be encountering.

img src="/html/images/002.jpg" alt="Dolls 2020" width="200px" height="80px"

Also, you should include pixel ('px') in your width an height values.

1 Like

For your attributes in any HTML tags you should wrap the values in quotation marks.

<img src="photo.jpeg" alt="some photo" />

1 Like

Hello,
Here is the situation
I have a folder called “dolls only”. Inside are two files:
-one is a folder image (with 5 pictures titled " nov2020 002.jpg-008.jpg" . It is called “dollspics.html”
-and the other is an html file. It is called “index.html”

I always get “ERR_FILE_NOT_FOUND” and never an image. But some rectangle with the word image inside.
<img src=“nov2020.jpg”

If you have any idea, that would be great.

Thank you

Sorry, I’m having a hard time visualizing what your folder is really looking like… when I setup my projects I’ll have the root folder. Inside will include index.html, img folder, css folder.

thank you, but still no pics

Can you share an image of your folders and how it’s set up? I’m having a hard time visualizing your folder structure

Thank you so much for your help, I appreciate it very much

Here are all the files in the project folder:

hope you can see the pictures in dolls.Ink. If not let me know.
dolls.lnk

(Attachment css folder.html is missing)

(Attachment index.html is missing)

here are two attachments required from your site

(Attachment css folder.html is missing)

(Attachment index.html is missing)

thank you , my instructor fixed it, but I still don’t know how to do it. I’ll try it. I’m studying now PHP,MySql , Apache…fascinating

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.