FAQ: Learn HTML - Intro to HTML - Images

This community-built FAQ covers the “Images” exercise in Codecademy’s lessons on HTML.

Here are the most popular community questions on this exercise:

Join the Discussion. We Want to Hear From You!

Have a new question or can answer someone else’s? Reply (reply) to an existing thread!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources about HTML in general? Go here!

Want to take the conversation in a totally different direction? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account, billing, Pro, or Pro Intensive? Reach out to our support team!

None of the above? Find out where to ask other questions here!

Other FAQs

The following are links to additional questions that our community has asked about this exercise:

Not seeing your question? It may still have been asked before – try searching for it by clicking the spyglass icon (search) in the top-right of this page. Still can’t find it? Ask it below by hitting the reply button below this post (reply).

This exercize had a hint that said to not forget to add quotation marks around the URL in the src attribute of an img tag. When are quotes and double quotes needed in HTML in general?

2 Likes

6 posts were split to a new topic: What are self-closing tags?

6 posts were merged into an existing topic: How can I store my own images online?

3 posts were split to a new topic: Indention in HTML -images

How will I know when to use quotation marks in HTML? When should I use it?

I have a question. Please have a look at the above screen shot. Notice the error message, in red letters, on the bottom of the middle panel. It claims that I made a spelling error when it comes to typing the URL in the exercise. I have NOT made a spelling error when it comes to the URL. Now I can’t move to the next exercise.

And yes, I did use a closing >, it’s just that the error message is blocking the >.

You only have part of the URL in the image tag, here’s the full URL

https://s3.amazonaws.com/codecademy-content/courses/web-101/web101-image_brownbear.jpg

2 Likes

Well formed code always has quote marks around all attribute values. Some attributes are boolean. They are an exception to this rule, only if written implicitly.

 <input type="checkbox" checked="checked">

 <input type="checkbox" checked>

Us old schoolers are pretty set on using double quotes in HTML attributes. I, for one prefer the consistency, even in script generated markup.

 let li = `<li id="item${i}">${item}</li>`

The above is an example of a line in a JS loop.

1 Like

My course says I haven’t completed my task properly but I don’t know why?

In line 28, the src attribute should be written with quotes around the URL to be well formed.

<img src="%URL">

Of course!

Thank you.

1 Like

Does the image source address need to be in quotes? My code ran without it.

It’s more a question of convention than what the browser will allow. If we drill down to the core specs, quotes don’t matter in HTML 4. Attributes without quotes are just as valid. However, and that is a big, however, convention suggests that we never write unquoted attributes unless they are booleans.

<input type="radio" checked>
1 Like

Makes sense! Thank you for the clarification.

Why must we make sure to wrap the link in quotation marks?

In this lesson I had to use the following URL to show an image:

But the correct URL turned out to be:

There was no way I could’ve gotten this without asking for help. Coding is hard.

1 Like

As of 24/09/2020, sample code given is wrong.

1 Like