Lesson 2 of 8
Links and images
- 8 min
- 4 checks
- 3 hints
- Go to task
Goal
Tags with attributes
Explanation
Some tags need extra information that you write inside the tag itself. These pieces of information are called attributes. A link needs the address of the page it takes you to, and an image needs a source to load from.
A link is written like this: <a href="...">link text</a>, and an image like this: <img src="..." alt="...">.
The alt attribute isn't optional. It's the text a screen reader reads out to people who can't see the image, and it's what shows up in place of the image if it fails to load.
Your task
Add a link to a site you love, and add an image with alt text that describes it.
Checks
4 checks- There is an a element whose href starts with http
- The link text isn't empty
- There is an img element with a src
- The image has alt text that describes it in more than one word