Be Brav3

FCC Challenge 24: Turn an Image into a Link

March 09, 2016

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 element.

Nest your image within an a element. Here’s an example:

[html]

Three kittens running towards the camera.

[/html]

Remember to use # as your a element’s href property in order to turn it into a dead link.

Place the existing image element within an anchor element.

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.

The original code looks like:

[html highlight=”32″]

CatPhotoApp

Click here for cat photos.

A cute orange cat lying on its back.

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.

[/html]

The updated code with clickable image leading to an URL should look like:

[html highlight=”32″]

CatPhotoApp

Click here for cat photos.

A cute orange cat lying on its back.

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.

[/html]