Tell us what’s happening:
Describe your issue in detail here.
Here again Im struggling with the code…where am I supposed to put the a href code “within” the img code? The hint keep shows me " Your anchor (a ) element should have an opening tag. Opening tags have this syntax: <elementName> ." but I don’t get it…Could anyone help please?
Your code so far
<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."<a href="https://freecatphotoapp.com">cat photos</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
The a tag is used to link webpages together. so for example if you have a webpage which when you click it, takes you to google.com You can do something like this:
// destination-link link text
| |
<a href="https://google.com"> a link to google </a>
even though the user will only see the text a link to google and when someone clicks it, the user will be taken to the google’s website.
Here in the same way, you need to a link to https://freecatphotoapp.com with the text “cat photos” in this challenge.
Hope this helps!
As I said above it doesn’t really matter what kind of content it is, You can turn them into a link if you just add that content inside of an anchor tag like this: <a> your contennt </a> So just use this idea to turn your image into a link. You can do this