{"componentChunkName":"component---src-templates-blog-post-js","path":"/blog/freecodecamp/frontend/html/fcc-challenge-24-turn-an-image-into-a-link/","result":{"data":{"site":{"siteMetadata":{"title":"Be Brav3"}},"markdownRemark":{"id":"8e1f2c8f-2d35-5c94-b157-07c57027f0f1","excerpt":"In Free Code Camp Challenge 24 we can turn an image into a clickable image that leads to an URL. You can make elements into links by nesting them within an a…","html":"<p>In <a href=\"https://www.freecodecamp.com/challenges/turn-an-image-into-a-link\">Free Code Camp Challenge 24</a> we can turn an image into a clickable image that leads to an URL.</p>\n<blockquote>\n<p>You can make elements into links by nesting them within an a element.</p>\n<p>Nest your image within an a element. Here’s an example:</p>\n</blockquote>\n<blockquote>\n<p>[html]</p>\n</blockquote>\n<blockquote>\n<p><a href=\"#\"><img src=\"https://bit.ly/fcc-running-cats\" alt=\"Three kittens running towards the camera. \"></a></p>\n</blockquote>\n<blockquote>\n<p>[/html]</p>\n</blockquote>\n<blockquote>\n<p>Remember to use # as your a element’s href property in order to turn it into a dead link.</p>\n<p>Place the existing image element within an anchor element.</p>\n<p>Once you’ve done this, hover over your image with your cursor. Your cursor’s normal pointer should become the link clicking pointer. The photo is now a link.</p>\n</blockquote>\n<p>The original code looks like:</p>\n<p>[html highlight=”32″]</p>\n<link href=\"https://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">\n  \n<style>\n    \n.red-text {\n      \ncolor: red;\n    \n}\n<p>h2 {</p>\n<p>font-family: Lobster, Monospace;</p>\n<p>}</p>\n<p>p {</p>\n<p>font-size: 16px;</p>\n<p>font-family: Monospace;</p>\n<p>}</p>\n<p>.thick-green-border {</p>\n<p>border-color: green;</p>\n<p>border-width: 10px;</p>\n<p>border-style: solid;</p>\n<p>border-radius: 50%;</p>\n<p>}</p>\n<p>.smaller-image {</p>\n<p>width: 100px;</p>\n<p>}</p>\n</style>\n<h2 class=\"red-text\">CatPhotoApp</h2>\n<p>Click here for <a href=\"#\">cat photos</a>.</p>\n<img class=\"smaller-image thick-green-border\" src=\"https://bit.ly/fcc-relaxing-cat\" alt=\"A cute orange cat lying on its back. \">\n<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>\n  \n<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>\n  \n[/html]\n<p>The updated code with clickable image leading to an URL should look like:</p>\n<p>[html highlight=”32″]</p>\n<link href=\"https://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">\n  \n<style>\n    \n.red-text {\n      \ncolor: red;\n    \n}\n<p>h2 {</p>\n<p>font-family: Lobster, Monospace;</p>\n<p>}</p>\n<p>p {</p>\n<p>font-size: 16px;</p>\n<p>font-family: Monospace;</p>\n<p>}</p>\n<p>.thick-green-border {</p>\n<p>border-color: green;</p>\n<p>border-width: 10px;</p>\n<p>border-style: solid;</p>\n<p>border-radius: 50%;</p>\n<p>}</p>\n<p>.smaller-image {</p>\n<p>width: 100px;</p>\n<p>}</p>\n</style>\n<h2 class=\"red-text\">CatPhotoApp</h2>\n<p>Click here for <a href=\"#\">cat photos</a>.</p>\n<p><a href=\"#\"><img class=\"smaller-image thick-green-border\" src=\"https://bit.ly/fcc-relaxing-cat\" alt=\"A cute orange cat lying on its back. \"></a></p>\n<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>\n  \n<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>\n  \n[/html]","frontmatter":{"title":"FCC Challenge 24: Turn an Image into a Link","date":"March 09, 2016","description":null}}},"pageContext":{"slug":"/blog/freecodecamp/frontend/html/fcc-challenge-24-turn-an-image-into-a-link/","previous":{"fields":{"slug":"/blog/freecodecamp/frontend/html/fcc-challenge-23-make-dead-links-using-the-hash-symbol/"},"frontmatter":{"title":"FCC Challenge 23: Make Dead Links using the Hash Symbol"}},"next":{"fields":{"slug":"/blog/selenium/locating-a-webelement-with-selenium-webdriver/"},"frontmatter":{"title":"Locating a WebElement With Selenium WebDriver"}}}}}