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.💬 Why do coders write comments? (a) to make links (b) to leave notes (c) to add colour (d) to show pictures
-
2.🔗 Where does this link open?
<a href="games.html" target="_blank">Contact us</a> (a) in the same tab (b) in a new tab - 3.📄 Can HTML on its own make headings? (a) No (b) Yes
- 4.📝 Does <hr> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
- 5.🔠 Which heading shows the SMALLEST text: <h3>, <h5>, <h1> or <h4>? (a) <h1> (b) <h5> (c) <h3> (d) <h4>
- 6.📄 Can HTML on its own pick a random number? (a) No (b) Yes
- 7.🔠 Which heading shows the BIGGEST text: <h1>, <h5>, <h2> or <h4>? (a) <h2> (b) <h1> (c) <h5> (d) <h4>
- 8.🖼️ Which attribute of <img> tells which image to load? (a) alt (b) height (c) src (d) width
- 9.Which of these goes in the body? (a) <title> (b) <a> (c) <meta charset="utf-8"> (d) <link rel="stylesheet">
- 10.True or false: in <img>, alt names the picture file. (a) True (b) False
-
11.📝 On how many lines does the browser show this paragraph?
<p>Stars shine<br>Kites fly high</p> -
12.📋 How many items does this list show?
<ul>
<li>Mango</li>
<li>Grapes</li>
<li>Jamun</li>
<li>Banana</li>
<li>Orange</li>
<li>Litchi</li>
</ul> -
13.📋 What number does the browser show next to “Guava”?
<ol start="4">
<li>Papaya</li>
<li>Jamun</li>
<li>Grapes</li>
<li>Guava</li>
<li>Banana</li>
<li>Mango</li>
</ol> -
14.📋 What number does the browser show next to “Orange”?
<ol>
<li>Grapes</li>
<li>Papaya</li>
<li>Litchi</li>
<li>Guava</li>
<li>Orange</li>
<li>Jamun</li>
</ol> - 15.Which of these goes in the body? (a) <style> (b) <meta charset="utf-8"> (c) <h1> (d) <link rel="stylesheet">
- 16.Which of these has a closing tag? (a) <img> (b) <hr> (c) <input> (d) <b>
-
17.🔍 Which line is missing its closing tag?
line 1: <h3>Rain today
line 2: <p>Hello, world!</p>
line 3: <i>The red kite</i> (a) line 3 (b) line 1 (c) line 2 - 18.📋 Which list shows the steps of a recipe best? (a) <ul> (b) <hr> (c) <ol> (d) <br>
- 19.Which of these has a closing tag? (a) <meta> (b) <img> (c) <h1> (d) <br>
- 20.True or false: <ul> shows 1, 2, 3 numbers. (a) True (b) False
-
21.🖼️ Which picture file does the browser load?
<img src="tiger.jpg" alt="A tiger asleep" width="50"> (a) A tiger asleep (b) kite.png (c) map.png (d) tiger.jpg - 22.Which of these is an opening tag? (a) </title> (b) <p> (c) </h1> (d) </p>
-
23.🔍 Which line is missing its closing tag?
line 1: <h2>Fun facts</h2>
line 2: <i>Rain today</i>
line 3: <b>My pets (a) line 2 (b) line 3 (c) line 1 -
24.📝 How many paragraphs does this code make?
<p>Cricket is fun.</p>
<h2>Hello, world!</h2>
<h2>Cricket is fun.</h2>
<h2>Our school trip</h2> - 25.🏷️ Is <p> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
- 26.True or false: <p> is an empty tag. (a) True (b) False
- 27.Which of these is an empty tag? (a) <b> (b) <ul> (c) <hr> (d) <li>
-
28.💬 How many paragraphs show on the page?
<p>Our school trip</p>
<p>Hello, world!</p>
<!-- <p>Cricket is fun.</p> -->
<!-- <p>My pets</p> --> - 29.📋 Which tag goes around each item of a list? (a) <ul> (b) <li> (c) <ol> (d) <p>
-
30.💬 Which text will NOT show on the page?
<p>I love mangoes.</p>
<!-- <p>Cricket is fun.</p> -->
<p>Hello, world!</p>
<p>Our school trip</p> (a) Our school trip (b) I love mangoes. (c) Cricket is fun. (d) Hello, world! - 31.🏷️ Is </h1> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
- 32.🔠 Which heading shows the BIGGEST text: <h1>, <h3>, <h4> or <h2>? (a) <h2> (b) <h4> (c) <h1> (d) <h3>
- 33.💬 How does an HTML comment end? (a) // (b) */ (c) >> (d) -->
-
34.🔗 Which words do you click on?
<a href="quiz.html">About us</a> (a) quiz.html (b) href (c) About us (d) Contact us - 35.🔠 Which heading shows the SMALLEST text: <h4>, <h1>, <h3> or <h6>? (a) <h4> (b) <h1> (c) <h3> (d) <h6>
-
36.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="cake.jpg" alt="Birthday cake" width="50"> (a) A happy dog (b) Birthday cake (c) cake.jpg (d) width - 37.🔗 Which attribute holds the address of a link? (a) id (b) href (c) src (d) alt
-
38.📝 How many paragraphs does this code make?
<p>Hello, world!</p>
<p>Our school trip</p>
<p>Rain today</p> -
39.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="kite.png" alt="A red kite" width="350"> (a) A red kite (b) kite.png (c) width (d) Map of India -
40.🖼️ Which picture file does the browser load?
<img src="map.png" alt="Map of India" width="100"> (a) Map of India (b) cake.jpg (c) map.png (d) dog.jpg
Answer key
- to leave notes
- in a new tab
- Yes
- an empty tag
- <h5>
- No
- <h1>
- src
- <a>
- False
- 2
- 6
- 7
- 5
- <h1>
- <b>
- line 1
- <ol>
- <h1>
- False
- tiger.jpg
- <p>
- line 3
- 1
- an opening tag
- False
- <hr>
- 2
- <li>
- Cricket is fun.
- a closing tag
- <h1>
- -->
- About us
- <h6>
- Birthday cake
- href
- 3
- A red kite
- map.png
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids