djd43
October 12, 2022, 7:03pm
1
I have no idea where to put the anchor and href inside the image so it will make the image a link provided
Your code so far
<html>
<body>
<main>
<h1>CatPhotoApp</h1>
<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."> <a> href="https://freecatphotoapp.com"</a>
</main>
</body>
</html>
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36
Challenge: Learn HTML by Building a Cat Photo App - Step 15
Link to the challenge:
This isn’t how you create an anchor element.
Look back at the last anchor element you just completed:
You need to follow this example, but instead of the text ‘cat photos’, you will use the img
element.
djd43
October 12, 2022, 7:11pm
3
Still unsure how to do this. I feel like i’ve done what you’re trying to say but clearly I am not
djd43
October 12, 2022, 7:12pm
4
<a href="https://freecatphotoapp.com" <img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg"</a> alt="A cute orange cat lying on its back.">
Can you see any differences between
this:
and this:
This is not a valid opening anchor tag.
djd43:
"</a> alt="
You cannot put the closing tag for one element inside of the middle of another element’s tags.
djd43
October 12, 2022, 7:15pm
7
where do i start the anchor at? That is what i am most confused about
djd43
October 12, 2022, 7:15pm
8
I will have to leave here soon so i don’t know when i will reply next
Start? The full opening tag needs to go before the thing you want to turn into a link - which is the img
element in this case.
djd43
October 12, 2022, 7:23pm
10
how do i turn an img element into a link? I’m struggling with placement where to start things. there is very little direction
The direction is there, but it expects you to remember what you did on previous steps and the technical words that were used. Sometimes brains forget things.
Do you know what I mean when I say “opening tag”? What is the “opening anchor tag” here:
djd43
October 12, 2022, 7:31pm
12
i don’t know. Id guess the <a
Nope.
An element is a part of a webpage. In XML and HTML, an element may contain a data item or a chunk of text or an image, or perhaps nothing. A typical element includes an opening tag with some attributes, enclosed text content, and a closing tag.
So… what’s the opening anchor tag above?
djd43
October 12, 2022, 7:33pm
14
<a target="_blank" href="https://freecatphotoapp.com">
I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>
) to add backticks around text.
See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').
djd43
October 12, 2022, 7:35pm
16
im extreamly confused on what you’re trying to say on how to make it clearer
Right.
This step is asking you to put the img
element inside of a new anchor element.
That means you need to put a new opening anchor tag before the img
element and a new closing anchor tag after the img
element. You should not change the img
element.
djd43
October 12, 2022, 7:36pm
18
what about the alt inside the img element
You should change nothing about the img
element. The instructions did not ask you to change the img
, only wrap it inside of an anchor element.
djd43
October 12, 2022, 7:38pm
20
Okay. What did you mean about back tiks? i have never heard that term before and do not know where I made code in the forum