Inserting Images explainer

The aim of this puzzle: Add an image to a webpage.

Walkthrough of the solution: In this puzzle, you’ll add another image to the webpage.

The <img> tag adds an image to a webpage. It doesn’t need a closing tag like other elements but it must have an src attribute that points to the location of the image. For example, the code below adds the image filename.jpeg to a webpage:

<img src='filename.jpg'> 

An image tag can also have an alt attribute. The alt attribute is optional and provides a text description that is useful when the image can’t be displayed or viewed. For example:

<img src=’flowers.jpg' alt=’picture of a sunflower’> 

To complete the puzzle, inside the HTML, add a new <img> tag below the existing <img>. Then, set its src attribute to ../../static/images/cat.jpg. Finally, give it an alt attribute and set its value to ’picture of Edgar’.

Sample code solution:
(Tap below to reveal)


        <img src='../../static/images/catInBag.jpg' alt='picture of Moo'>
        <img src='../../static/images/cat.jpg' alt='picture of Edgar'>

HTML Concepts: <html>, <body>, <img>, HTML element, HTML attribute

hello, i tried your puzzle solution and the help said so the starter html has been changed but i didn’t change it.

Hey there, try posting a screenshot of your code and I’ll take a look.

Nevermind it worked, It just didn’t load it.

please why is this code not passing me through this page?

its worked already

Glad to hear it’s working! It looks like the webview where the code output is shown either crashed or failed to load properly. If that happens, refreshing the page should solve the problem.

Thank you strong text

HELP i don’t know whats wrong

Hey there, looks like a small typo. Try changing scr to src in the 2nd <img> tag.

THANK U SOOO MUCH :sweat_smile: :grin:

Hi! How is this possible?

Excuse me. Why is not my code working? I had clicked the ‘Run Code’ button several times and I even wrote the code correct.

It looks like the image tags are missing their closing angle brackets, try adding /> to the end of each image tag.

You need to put a / before the closing angle brackets

What do you mean. Like…?

1 Like

Never mind, it already worked

why my code only return a "Eric Blackmon ERROR?

1 Like