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 we add alt text to an image? (a) to load it faster (b) to describe the image (c) to colour it (d) to make it bigger
- 2.Which of these is an opening tag? (a) </li> (b) <h1> (c) </p> (d) </h1>
- 3.True or false: <ul> goes inside ul or ol. (a) True (b) False
-
4.🖼️ How many pixels wide is the picture drawn?
<img src="fort.jpg" alt="An old fort" width="150"> -
5.📝 How many paragraphs does this code make?
<p>Good morning!</p>
<p>Cricket is fun.</p>
<h2>The red kite</h2>
<h2>The red kite</h2>
<p>I love mangoes.</p> -
6.📝 On how many lines does the browser show this paragraph?
<p>Sky is blue<br>Rivers flow</p> - 7.📋 Which list tag is an ordered list? (a) <ul> (b) <ol> (c) <li>
- 8.📝 Does <input> have a closing tag, or is it an empty tag? (a) has a closing tag (b) an empty tag
- 9.🔗 What does HyperText mean? (a) text with links (b) very big text (c) text in colour (d) secret text
-
10.🖼️ Which picture file does the browser load?
<img src="fort.jpg" alt="An old fort" width="350"> (a) kite.png (b) An old fort (c) fort.jpg (d) tiger.jpg -
11.🔠 How many headings are in this code?
<h1>The red kite</h1>
<p>Cricket is fun.</p>
<p>The red kite</p>
<p>Fun facts</p> -
12.🔍 Which line is missing its closing tag?
line 1: <small>The red kite</small>
line 2: <em>Our school trip</em>
line 3: <h1>Good morning! (a) line 3 (b) line 1 (c) line 2 - 13.🏷️ Is </li> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
-
14.🔍 One closing tag is missing. Which one?
<em>My pets</em>
<h1>Fun facts
<u>I love mangoes.</u> (a) </i> (b) </u> (c) </h1> (d) </em> - 15.💬 How does an HTML comment end? (a) >> (b) */ (c) // (d) -->
-
16.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Riya’s Recipes</title>
</head>
<body>
<h1>My drawings</h1>
<p>Thanks for visiting.</p>
</body>
</html> (a) body (b) Riya’s Recipes (c) Thanks for visiting. (d) My drawings - 17.True or false: <li> lists things in any order. (a) True (b) False
- 18.📝 What does <p> make? (a) a paragraph (b) a picture (c) a link (d) a table
- 19.📄 Can HTML on its own pick a random number? (a) Yes (b) No
- 20.🔠 Which heading shows the SMALLEST text: <h2>, <h4>, <h1> or <h6>? (a) <h2> (b) <h1> (c) <h6> (d) <h4>
- 21.🌐 Which one has an address bar? (a) a code editor (b) a web browser (c) a web server
- 22.📄 Where does the text of <title> appear? (a) in a big heading (b) on the browser tab (c) at the bottom (d) nowhere
-
23.📋 What number does the browser show next to “Litchi”?
<ol start="9">
<li>Jamun</li>
<li>Banana</li>
<li>Litchi</li>
</ol> - 24.🔤 In “HTML”, what does the M stand for? (a) Markup (b) Machine (c) Modern (d) Mouse
- 25.🧩 An opening tag + content + a closing tag together make an ___. (a) element (b) address (c) editor (d) attribute
-
26.🖼️ How many pixels wide is the picture drawn?
<img src="tiger.jpg" alt="A tiger asleep" width="250"> - 27.True or false: <p> goes in the body. (a) False (b) True
-
28.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>Space Facts</title>
</head>
<body>
<h1>Welcome!</h1>
<p>We won by 5 runs.</p>
</body>
</html> (a) Welcome! (b) We won by 5 runs. (c) index.html (d) Space Facts -
29.🔗 Which address opens when you click this link?
<a href="contact.html">Take the quiz</a> (a) contact.html (b) maths.html (c) Take the quiz (d) https://example.com -
30.💬 Which text will NOT show on the page?
<p>Our school trip</p>
<!-- <p>Good morning!</p> -->
<p>My best friend</p> (a) My best friend (b) Good morning! (c) Our school trip - 31.True or false: HTML on its own cannot run a game loop. (a) True (b) False
-
32.💬 How many paragraphs show on the page?
<p>Rain today</p>
<!-- <p>My pets</p> -->
<p>Good morning!</p>
<!-- <p>Hello, world!</p> -->
<p>Fun facts</p> - 33.🔠 Which heading shows the SMALLEST text: <h5>, <h6>, <h1> or <h4>? (a) <h1> (b) <h4> (c) <h6> (d) <h5>
-
34.🔍 One closing tag is missing. Which one?
<small>I love mangoes.</small>
<b>Fun facts
<p>Hello, world!</p> (a) </p> (b) </b> (c) </u> (d) </small> -
35.🔗 Which words do you click on?
<a href="games.html">Visit the site</a> (a) Visit the site (b) Maths fun (c) games.html (d) href - 36.📄 Where does <h1> go: in the head or in the body? (a) in the head (b) in the body
- 37.True or false: a web server colours code to help us. (a) False (b) True
- 38.💬 How does an HTML comment start? (a) /* (b) # (c) // (d) <!--
- 39.🏷️ What does a closing tag have that an opening tag does not? (a) a dollar $ (b) a hash # (c) a slash / (d) a dot .
-
40.🔗 Which words do you click on?
<a href="art.html">Maths fun</a> (a) href (b) Maths fun (c) art.html (d) Art corner
Answer key
- to describe the image
- <h1>
- False
- 150
- 3
- 2
- <ol>
- an empty tag
- text with links
- fort.jpg
- 1
- line 3
- a closing tag
- </h1>
- -->
- My drawings
- False
- a paragraph
- No
- <h6>
- a web browser
- on the browser tab
- 11
- Markup
- element
- 250
- True
- Space Facts
- contact.html
- Good morning!
- True
- 3
- <h6>
- </b>
- Visit the site
- in the body
- False
- <!--
- a slash /
- Maths fun
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids