When creating an image as a link,what to enter in the href attribute of the A element?

hello friends
Can you please tell me that while using an image as a link,what needs to be entered in the href attribute of the A element?

in the tutorial,it says to set the href attribute to#, but doesn’t it changes the link into a dead link?

for example: .
so, what do i put inside of the href=""?

Your code so far


<h2>CatPhotoApp</h2>
<main>
<p>Click here to view more <a href="#">cat photos</a>.</p>

<img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back.">

<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
</main>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36.

Challenge: Turn an Image into a Link

Link to the challenge:

Yes, you’re correct. When you place # inside of the href attribute it makes it a dead link. We use these for example when we don’t have anything to put in the link yet or in exercises like this one.

Normally inside href attribute of a element you place your link, like so:

<a href="https://www.freecodecamp.org">
  <img src="cat.jpg" alt="quite fat cat" />
</a>
2 Likes

yes!thank you so much!