freeCodeCamp Challenge Guide: Add Images to Your Website

Add Images to Your Website


Problem Explanation

Img HTML elements belongs to the group of the “self-closing” HTML elements: it means that they do not follow the ordinary structure - open tag, put content, close tag - but they have just one tag which works as opening and closing tag:
As all opening tag it still can receive attributes though, and these are the tools you can use to manipulate the tag, put some content in, enhance accessibility, etc.
The main attributes of an img tag are src and alt:
Put here a brief description of the image

Attributes are key value pairs inserted into the tag. The syntax is <tag key1="value1" key2="value2"> </tag> or, in case of self-closing tags, <tag key1="value1" key2="value2" /> - notice that the pairs are separated by a space character, not by a comma.

<img src="insert URL of the image" alt="Cute dog smiling">

Relevant Links

14 Likes

In adding an image to my code I’ve used the following code relaxing-cat please help me by telling me what i’m doing wrong. Thank you.

8 Likes

Hey, I had practically the same issue. It seems that after removing the single dash between words it was able to process the alt element properly. Give it a try!

4 Likes

I am stuck here, please help!! Here’s my code:

fcc-relaxing-cat

5 Likes

See it works here but not on my page: =/

img src=“https://bit.ly/fcc-relaxing-cat” alt=“fcc-relaxing-cat”

3 Likes

this works fcc relaxing cat.

Hello Try this Out
Two cats lying down

Thanking You
Shawn Alexander

2 Likes

its not working guys

3 Likes

my code is
Author standing on a beach with two thumbs up.

but im stuck here…

Your image should have a src attribute that points to the kitten image.

how to pass this challenge?? plis who know??

8 Likes

Author standing on a beach with two thumbs up.

2 Likes

Thank you for your help! I don’t have any idea what coding is all about and I just started yesterday and to be honest I almost gave up and then I found you guys! Thanks again guys!!

7 Likes

It should be stated to add the code after your h2 line to work properly…

3 Likes

Can anyone tell me why my code isn’t working? I’ve been stuck here for hours.Cat laying on its back

1 Like

This is the code, which I noticed only works if I delete the space between the alt line and the end of the img line but it still isn’t working. Cat laying on its back

1 Like

Never mind, figured it out, lol. It wants the image on line 25, scroll all the way down.

2 Likes

Ladies and gents, any body figured this out yet? I am stuck here for hours now;

Thanks in advance for your guidance

3 Likes

Guys this worked for me.

Author standing on a beach with two thumbs up.

1 Like

Make sure you are outside of the style section. I was stuck on this for awhile until I discovered that the images don’t process inside of style.

5 Likes

I figured this out guys. I’m super stoked. Power through it guys.

3 Likes

place the code at first

1 Like