Year 8 Computing — HTML attributes and links
Read the attributes inside an opening tag, and work out where a link goes and which words a reader clicks to follow it.
Name: ________________________
1.An attribute is a name, an equals sign and a value in quotes, written inside the opening tag. How many attributes does “<img src="cat.png" alt="A cat" width="200">” have?
2.Match each attribute name to what it says.
- href
- src
- alt
- width
- Words to use in place of a picture
- How wide to draw a picture
- Which file a picture comes from
- Which page the link opens
3.A page holds “<a href="results.html">Click here</a>”. A reader clicks the words Click here. Which file opens?
4.In the picture tag “<img src="kite.png" alt="A paper kite">”, which file holds the picture?
5.Which of these is written as an attribute usually is — a name, an equals sign, then a value inside quotes?
- a) href home.html
- b) href-home.html
- c) href="home.html"
- d) "href"=home.html
6.Put these four pieces in the order they are written in the link “<a href="art.html">Art</a>”.
- Art
- <a
- </a>
- href="art.html">
7.A link is written “<a href="sport.html">Music</a>”. What happens when a reader clicks the word Music?
- a) Both pages open, one after the other
- b) The page music.html opens
- c) Nothing opens, because the two do not agree
- d) The page sport.html opens
8.In the link “<a href="notices.html">Notices</a>”, which word appears on the page for the reader to click?
Answer key — Year 8 Computing — HTML attributes and links
- 1. 3
- 2. href → Which page the link opens; src → Which file a picture comes from; alt → Words to use in place of a picture; width → How wide to draw a picture
- 3. results.html
- 4. kite.png
- 5. c) href="home.html"
- 6. 1. <a 2. href="art.html"> 3. Art 4. </a>
- 7. d) The page sport.html opens
- 8. Notices