Tell us what’s happening:
Describe your issue in detail here.
I can't seem to figure out how to turn the image into a link by surrounding it with necessary element tags. It says to use https://freecatphotoapp.com as the anchor's href attribute value, but I'm not quite sure how to do that. A little help sounds good! Thanks!
<html>
<body>
<h1>CatPhotoApp</h1>
<main>
<h2>Cat Photos</h2>
<!-- TODO: Add link to cat photos -->
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
<img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back.">target ="_blank" href="https://freecatphotoapp.com"</a>
</main>
</body>
</html>
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.115 Safari/537.36 OPR/88.0.4412.75
Hi!
First it looks like you’ve put your problem description inside where formatted code goes. Try not to put it inside the three backticks in future, it is hard to read.
Your problem description is great however! The details are very helpful.
So when you made the text ‘cat photos’ into a link you did it like this,
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
So, to make this work you need to write out the anchor element and put the img code where the text ‘cat photos’ was in the above example, you will turn the image into a link.
Hello!
Thanks for the comment! I’m still a little stuck, I copy and pasted the <img src and replaced thee “cat photos” in the above line but now i have two images. When I delete the image that isn’t the link, I get an error message.
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg"</a>.</p>
So I am having a hard time surrounding the image with the anchor’s href attribute value. I am just confused on how to properly add the attribute value.
that sounds a little confusing. Lets decompose the task and figure out what we need to do step by step
That’s the first part. You’ve already done that in previous steps, but with the text.
For now don’t bother with href and attribute and value stuff.
do just something like:
Ok, that’s correct syntax, but we don’t need p element here.
We need element to make a link, right? p is just paragraph, it is used to deal with bunch of simple text
I’m going to butt in if that’s okay, and suggest you read these pages on the anchor and paragraph element. As I feel you will benefit from reading up on the basics of them.