AgainColours
The exam

6 of 7

Pictures that are links

This lesson is closed. Finish the one before it. Do the practice. Pass the assessment. Then this one opens.

Go to The branch table

Back to the lesson. Three tries are used. Read this again, then try the code.

You finished. The lesson is open again.

Display at least four social media handles. Represent each handle with an image, as a link.
The exam paper

Look here

The clay outline is the part this lesson is about.

In plain words

Each social handle is a link, and the thing inside the link is a picture. The picture is an img. The link is an a wrapped around the img. Four is the minimum. Facebook, Instagram, X, and LinkedIn are enough. A fifth is fine. Four done properly is the mark.

1 of 3

The labels

<h2>Social media</h2>
<div class="social">
  <a href="https://facebook.com">
    <img src="icons/facebook.svg" alt="Facebook" width="64" height="64">
  </a>
  <a href="https://instagram.com">
    <img src="icons/instagram.svg" alt="Instagram" width="64" height="64">
  </a>
  <a href="https://x.com">
    <img src="icons/x.svg" alt="X" width="64" height="64">
  </a>
  <a href="https://linkedin.com">
    <img src="icons/linkedin.svg" alt="LinkedIn" width="64" height="64">
  </a>
</div>

The paint

.social a {
  display: inline-block;
  margin: 8px;
  padding: 8px;
  background: #ffffff;
  border: 1px solid #e4d9ce;
}

.social img {
  display: block;
  width: 64px;
  height: 64px;
}

Line by line

  1. <a href="https://facebook.com">The link. href is the place it opens. The picture goes inside, before </a>.
  2. <img src="icons/facebook.svg" alt="Facebook">src is the image file, including the folder. alt is the name of the handle, for when the picture cannot be seen.
  3. width="64" height="64"The size of the picture. The CSS sets the same size so the four icons match.
  4. Four anchorsFacebook, Instagram, X, LinkedIn. Each one is its own a, with its own img. Do not reuse one image file for two handles.

A friend wrote this

This is not your file, and it is not the version to copy. It is here so you can see the difference after the right labels.

<h3>Facebook</h3>
<img src="image 1.png" alt="image not found">

A friend put the picture on the page and never wrapped it in a link, so it cannot be opened. alt says “image not found”, which is what you write when you have already lost. The file name also has a space, and the same file was reused for another handle. Put the img inside the a. Set alt to the handle’s name.

The next lesson opens after you practice and pass the assessment.

Practice

The picture is on the page, and it is not a link. The alt text admits it failed. Fix Facebook.

Assessment

The lesson is closed. Pick one answer each, then mark it. A wrong answer tells you why, what to do, and what to remember.

Which one is a social handle done the way the paper asks?
Two handles use the same image file. What is wrong?