question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Nest the existing img element within an a element.

See original GitHub issue

Challenge Turn an Image into a Link has an issue. User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36. Please describe how to reproduce this issue, and include links to screenshots if possible.

My code:


<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

  p {
    font-size: 16px;
    font-family: Monospace;
  }

  .thick-green-border {
    border-color: green;
    border-width: 10px;
    border-style: solid;
    border-radius: 50%;
  }

  .smaller-image {
    width: 100px;
  }
</style>

<h2 class="red-text">CatPhotoApp</h2>

<p>Click here for cat photos<a href="#"><img src="https://bit.ly/fcc-running-cats" alt="Three kittens running towards the camera."></a></p>

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

<p class="red-text">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 class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
JohnSchumachercommented, Jul 23, 2017

help it did’t work

0reactions
Jagwanicommented, Apr 1, 2017

you forget to implement class after the img tag… removed solution by mod

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nest the existing img element within an a element - HTML-CSS
Your browser information: Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ ...
Read more >
Nest the existing img element within an a element. · Issue #8914
Challenge Turn an Image into a Link has an issue. User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, ...
Read more >
Can I nest an image inside a link and vice versa? - Codecademy
We can nest an image inside a link, yes. The reverse is not possible since images are void tags with no content. They...
Read more >
<img>: The Image Embed element - HTML - MDN Web Docs
The HTML element embeds an image into the document. ... To do so, nest the <img> tag inside the <a> . You should...
Read more >
HTML img element nested within an a element.. help for a ...
I know the problem is that I didnt close the img tag, then open a second a tag inside it. But I cant...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found