This forum is now read-only. Please use our new forums at discuss.codecademy.com.

HTML Basics Forum

View Course » View Exercise

275 points
5220f616abf82105310006c4_42268979
Submitted by
Jason Shippee
almost 4 years ago

Why is my link and image not working?

this is the line of code i am using

 <!DOCTYPE html>
<html>
    <head>
        <title></title>
    </head>
    <body>

        <img src="http://www.google.com/imgres?safe=off&sa=X&biw=1920&bih=979&tbm=isch&tbnid=JkT1NMDhaVd7xM:&imgrefurl=http://mashable.com/2012/12/03/google-grader/&docid=jpNjHG6My95J3M&imgurl=http://rack.2.mshcdn.com/media/ZgkyMDEyLzEyLzAzL2U0L3NlZWhvd3lvdXJnLjlyMS5qcGcKcAl0aHVtYgk5NTB4NTM0IwplCWpwZw/8fec6ce4/e71/see-how-your-google-results-measure-up-with-google-grader-video--6b8bbb4b41.jpg&w=950&h=534&ei=WICeUdOPGZOG0QHdo4GQCw&zoom=1&ved=1t:3588,r:1,s:0,i:155&iact=rc&dur=2154&page=1&tbnh=168&tbnw=300&start=0&ndsp=24&tx=91&ty=78>" />

        <a href="http://www.google/com"><img src="http://www.myimage.jpg" /></a>

        <a href="www.thinkgeek.com" <p>
            hello
            </p>
        </a>



    </body>
</html>

Why is it saying that i need a link in my image if i have one/ what is broken?
thanks


1 vote

permalink

Hi Jason, your link is unfinished.
You need to close it > add a title and close it again </a>. No spaces.

Com to think of it, remove the p tags from your own link, take the spaces out and add the > like I wrote before..

2933 points
5533b41186f55278520000c6_295543857
Submitted by
tony de araujo
almost 4 years ago

4 Comments

5220f616abf82105310006c4_42268979 Jason Shippee almost 4 years ago

the major issue is the image link, the second one , but thank you for pointing this error out as well :)

5533b41186f55278520000c6_295543857 tony de araujo almost 4 years ago

Did you solve your problem with the image link? it look good to me. Sometimes error messages point at something but the problem is in the surrounding areas. not necessarily where it points to.

51a90a64a9174cbde3000b84_160226329 Xlayadre almost 4 years ago

I am having the same problem... Where exactly am I having the issue?

<!DOCTYPE html>






</body>

5220f616abf82105310006c4_42268979 Jason Shippee almost 4 years ago

thanks for the help tony, took a little bit but finally got it!


1 vote

permalink

Hello Xlayadre, your last image is incorrectly linked.
Study the following patterns to see how an image, a link and an image with a link are formatted:

An image is coded like this:
<img src="http://www.imagename.jpg"/> .
A link is coded like this:
<a href="http://google.com">GOOGLE</a>.
To insert an image inside of a link just replace the title of the link(ex: GOOGLE) by the whole image code (example 1). Like this:
<a href="http://google.com"><img src="http://www.imagename.jpg"/></a>

2933 points
5533b41186f55278520000c6_295543857
Submitted by
tony de araujo
almost 4 years ago