I got stuck on adding an image to my website

I am in process of learning how to add an image to my website but it doesn’t go through. Any advice please?


<h2>CatPhotoApp</h2>
<main>
<img src=“https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg” alt=“A business cat wearing a necktie.”> <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 (iPad; CPU OS 12_5_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.2 Mobile/15E148 Safari/604.1

Challenge: Add Images to Your Website

Link to the challenge:

you can try putting the p tag on a new line, see if that helps

You forgot to put a / on the closing img tag.

Your img tag should look like this:

<img src=“https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg” alt=“A business cat wearing a necktie.”/>

img elements are self closing

You are using the wrong kind of quotes. It should be normal double quotes "" not “”.

You may have to turn off smart punctuation.


@kazooi This isn’t JSX, it is HTML. :slight_smile:

img elements are self closing

Oh thats right, I just recognized :slight_smile:

1 Like

It’s all good. It doesn’t hurt to add it but it isn’t required.

Prettier will add it and it’s a formatter used by everyone (well almost everyone). So it’s not uncommon to see it in HTML.

1 Like

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