HTML Worksheet: Practice Test
Code tip (Read the code like a browser): Find the topic of the question: tags, headings, lists, links, images, structure or comments. Read the code line by line, the way a browser would. Count carefully: tags opened and closed, items, lines, paragraphs.
NameDateTime takenScore ___ / 40
-
1.🖼️ Which picture file does the browser load?
<img src="map.png" alt="Map of India" width="250"> (a) map.png (b) cake.jpg (c) Map of India (d) dog.jpg - 2.🖼️ Does <img> need a closing tag? (a) Yes (b) No
- 3.🔠 Which heading shows the BIGGEST text: <h2>, <h6>, <h5> or <h1>? (a) <h1> (b) <h5> (c) <h2> (d) <h6>
- 4.📋 Which list tag is an ordered list? (a) <ol> (b) <ul> (c) <li>
- 5.Which of these is true of a code editor? (a) stores a website’s files (b) has an address bar (c) is where we type code (d) answers page requests
- 6.True or false: <li> shows 1, 2, 3 numbers. (a) True (b) False
- 7.🔠 Which heading shows the BIGGEST text: <h2>, <h1>, <h6> or <h5>? (a) <h5> (b) <h1> (c) <h6> (d) <h2>
-
8.📝 How many paragraphs does this code make?
<p>The red kite</p>
<p>My pets</p>
<p>Rain today</p>
<p>Cricket is fun.</p>
<h2>Hello, world!</h2> - 9.💬 Why do coders write comments? (a) to show pictures (b) to make links (c) to leave notes (d) to add colour
-
10.💬 Which text will NOT show on the page?
<p>Good morning!</p>
<p>Our school trip</p>
<p>I love mangoes.</p>
<!-- <p>Hello, world!</p> --> (a) I love mangoes. (b) Our school trip (c) Hello, world! (d) Good morning! - 11.🔠 Which tag is the least important heading? (a) <h1> (b) <h3> (c) <p> (d) <h6>
- 12.Which of these is true of a web server? (a) is where we type code (b) has an address bar (c) hosts websites online (d) opens web pages for us
- 13.📄 What is the first line of an HTML5 page? (a) <!DOCTYPE html> (b) <html> (c) <head> (d) <body>
- 14.📋 Which list suits a shopping list in any order? (a) <hr> (b) <ol> (c) <br> (d) <ul>
-
15.🔠 How many headings are in this code?
<h1>My pets</h1>
<h3>Fun facts</h3>
<h3>My pets</h3> - 16.🖼️ Which attribute of <img> names the picture file? (a) width (b) alt (c) height (d) src
- 17.🖼️ Which attribute of <img> shows if the image fails? (a) alt (b) width (c) height (d) src
- 18.📝 You type 5 spaces between two words in a <p>. How does the browser show them? (a) as a new line (b) as a dot (c) as 5 spaces (d) as one space
- 19.📋 Which list tag is an unordered list? (a) <li> (b) <ul> (c) <ol>
- 20.True or false: <ul> has a closing tag. (a) False (b) True
- 21.True or false: in <img>, src sets how wide it is. (a) False (b) True
-
22.🔗 Which words do you click on?
<a href="games.html">Contact us</a> (a) games.html (b) Visit the site (c) href (d) Contact us - 23.🏷️ Which is the closing tag for <h3>? (a) <h3/> (b) <h3> (c) </h3> (d) <\h3>
- 24.True or false: a code editor shows line numbers. (a) False (b) True
- 25.🔠 How many <h1> headings should a page usually have? (a) 6 (b) 1 (c) 10 (d) 3
- 26.True or false: <ul> is one item of a list. (a) True (b) False
- 27.📝 Does <meta> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
-
28.🔠 How many headings are in this code?
<h1>My best friend</h1>
<p>Hello, world!</p>
<p>My pets</p> -
29.🔠 How many headings are in this code?
<h1>Our school trip</h1>
<p>Hello, world!</p>
<p>Our school trip</p>
<p>My pets</p> -
30.📋 How many items does this list show?
<ol>
<li>Papaya</li>
<li>Jamun</li>
<li>Mango</li>
<li>Orange</li>
<li>Guava</li>
</ol> - 31.🔠 Which heading shows the BIGGEST text: <h3>, <h4>, <h5> or <h6>? (a) <h6> (b) <h5> (c) <h3> (d) <h4>
- 32.🏷️ Is <b> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
-
33.🖼️ How many pixels wide is the picture drawn?
<img src="kite.png" alt="A red kite" width="400"> -
34.📝 On how many lines does the browser show this paragraph?
<p>Roses are red<br>Sky is blue<br>Kites fly high</p> - 35.🔠 Which heading shows the SMALLEST text: <h5>, <h4>, <h1> or <h6>? (a) <h4> (b) <h5> (c) <h6> (d) <h1>
-
36.🖼️ Which picture file does the browser load?
<img src="moon.png" alt="The full moon" width="150"> (a) fort.jpg (b) moon.png (c) bus.jpg (d) The full moon - 37.📋 Which list tag shows 1, 2, 3 numbers? (a) <ol> (b) <ul> (c) <li>
- 38.🔠 Which heading shows the SMALLEST text: <h3>, <h5>, <h2> or <h4>? (a) <h2> (b) <h4> (c) <h5> (d) <h3>
- 39.True or false: in <img>, height describes the picture. (a) False (b) True
- 40.📄 Where does <p> go: in the head or in the body? (a) in the head (b) in the body
Answer key
- map.png
- No
- <h1>
- <ol>
- is where we type code
- False
- <h1>
- 4
- to leave notes
- Hello, world!
- <h6>
- hosts websites online
- <!DOCTYPE html>
- <ul>
- 3
- src
- alt
- as one space
- <ul>
- True
- False
- Contact us
- </h3>
- True
- 1
- False
- an empty tag
- 1
- 1
- 5
- <h3>
- an opening tag
- 400
- 3
- <h6>
- moon.png
- <ol>
- <h5>
- False
- in the body
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids