Class 7 Computer Science — 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.Sort each opening tag by whether it carries an attribute.
Groups: Carries an attribute · Carries none
- <a href="home.html">
- <a href="maths.html">
- <img src="sun.png">
- <b>
- <p>
- <h1>
2.Match each attribute name to what it says.
- href
- src
- alt
- width
- Words to use in place of a picture
- Which file a picture comes from
- How wide to draw a picture
- Which page the link opens
3.In the picture tag “<img src="kite.png" alt="A paper kite">”, what is the alt attribute for?
- a) The name the picture is saved under
- b) Words describing the picture, for a reader who cannot see it
- c) The page the picture links to
- d) The size the picture should be drawn at
4.A link is written “<a href="sport.html">Music</a>”. What happens when a reader clicks the word Music?
- a) The page sport.html opens
- b) Nothing opens, because the two do not agree
- c) Both pages open, one after the other
- d) The page music.html opens
5.A page holds “<a href="results.html">Click here</a>”. A reader clicks the words Click here. Which file opens?
6.In the picture tag “<img src="kite.png" alt="A paper kite">”, which file holds the picture?
7.A page holds “<a href="library.html">Books</a>”. Which piece is the link text and which is the destination?
- a) Books is the text; library.html is the destination
- b) Both pieces are the text
- c) Both pieces are the destination
- d) library.html is the text; Books is the destination
8.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?
Answer key — Class 7 Computer Science — HTML attributes and links
- 1. <p> → Carries none; <a href="home.html"> → Carries an attribute; <img src="sun.png"> → Carries an attribute; <b> → Carries none; <h1> → Carries none; <a href="maths.html"> → Carries an attribute
- 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. b) Words describing the picture, for a reader who cannot see it
- 4. a) The page sport.html opens
- 5. results.html
- 6. kite.png
- 7. a) Books is the text; library.html is the destination
- 8. 3