Codeloft
0 0 XP

Links and images

7 min 20 XP + 10 for no hints

A link uses the <a> element. Its attribute href says where the link goes.

An image uses <img>. It has no closing tag. src points to the picture file and alt describes it for people using screen readers, or for anyone when the picture can't load.

Pictures from other websites are blocked in this practice area, so your image shows its alt text instead. That's a good way to see why alt text matters.

Example
<p>
  <a href="https://developer.mozilla.org">Learn more on MDN</a>
</p>
<img src="cat.jpg" alt="A grey cat asleep on a sofa">
Attribute values go inside double quotes: href="https://example.org".

Your tasks

0 of 2 done
  1. Add a link whose href points to https://example.org
  2. Add an image with a src and alt text that describes it

Quick check

What does the alt attribute do?

places.htmlUpdates as you type