Attributes not recognized, send help


#1


I am currently working through the course in the link below and I up to the part about links and images. When I set attributes such as href= it does not recognise the href. Basically, the attribute doesn't turn green.


https://www.codecademy.com/courses/learn-html-css/lessons/common-elements/exercises/img-src?action=lesson_resume


As you can see in the code below, the attribute 'src' turns green to show that it is an attribute. When doing the exercises in the course mine doesn't turn green or function as an attribute, instead it treats as part of the visible link name.

What am I doing wrong?


<img>src="https://www.example.com/picture.jpg"/>


#2

<img>src="https://www.example.com/picture.jpg"/>

You're opening the img tag with < and closing it straight away with >

Because of that, src isn't recognized as part of the tag.

The image tag begins with < and closes at />

Everything in between should be part of it. Therefore, try this instead:

<img src="https://www.example.com/picture.jpg" />


#3

Thank you for the swift (and correct) reply. Because most other tags use < and > immediately, I just assumed that everything would be.

Was really stuck but now makes much more sense!


#4

Maybe using the =book= is a good idear
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img


#5

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