Grade 6 Computer Science — Reading HTML tags
Read a line of HTML: find the opening and closing tags of an element, and say what a browser will show.
Name: ________________________
1.Here is a line of HTML: "<p>Hello</p>". Every element has an opening tag and a closing tag. Write the closing tag from that line.
2.An element opens with the tag "<h1>". Write the tag that closes it.
3.An element opens with the tag "<b>". Write the tag that closes it.
4.You write an opening <b> tag and forget its closing tag altogether. What is a browser most likely to do?
- a) Refuse to show the page at all
- b) Add the closing tag for you in your file
- c) Keep applying that tag to everything after it
- d) Show the missing tag as words on the page
5.Here is some HTML: "<ul><li>Tea</li><li>Milk</li><li>Sugar</li></ul>". How many items are in the list?
6.In the line "<h1>Welcome</h1>", which single word will a browser show as the heading?
7.Sort each tag by whether it opens an element or closes one.
Groups: Opening tag · Closing tag
- </h1>
- <h1>
- <p>
- </p>
- </li>
- <li>
8.Which one of these lines is written correctly, with each element closed inside the one that holds it?
- a) <b><i>Hi</b></i>
- b) <i>Hi<b>
- c) <b><i>Hi</i></b>
- d) <b>Hi</i>
Answer key — Grade 6 Computer Science — Reading HTML tags
- 1. </p>
- 2. </h1>
- 3. </b>
- 4. c) Keep applying that tag to everything after it
- 5. 3
- 6. Welcome
- 7. <p> → Opening tag; </p> → Closing tag; <h1> → Opening tag; </h1> → Closing tag; <li> → Opening tag; </li> → Closing tag
- 8. c) <b><i>Hi</i></b>