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.True or false: <li> is an unordered list. (a) True (b) False
- 2.💬 Why do coders write comments? (a) to make links (b) to show pictures (c) to add colour (d) to leave notes
- 3.📄 Where does <style> go: in the head or in the body? (a) in the body (b) in the head
- 4.🔍 Which is the odd one out? (a) has an address bar (b) opens web pages for us (c) turns HTML into a page (d) colours code to help us
- 5.📝 What does <hr> draw? (a) a picture (b) a table (c) a link (d) a line across the page
-
6.🖼️ How many pixels wide is the picture drawn?
<img src="map.png" alt="Map of India" width="300"> -
7.💬 Which text will NOT show on the page?
<!-- <p>Fun facts</p> -->
<p>Our school trip</p>
<p>The red kite</p>
<p>Good morning!</p> (a) The red kite (b) Good morning! (c) Fun facts (d) Our school trip - 8.📋 Which list suits a shopping list in any order? (a) <br> (b) <ul> (c) <hr> (d) <ol>
- 9.Which of these is an opening tag? (a) </li> (b) </p> (c) </title> (d) <title>
-
10.🔗 Which words do you click on?
<a href="https://example.com">Maths fun</a> (a) https://example.com (b) Art corner (c) href (d) Maths fun - 11.🖼️ Which attribute of <img> is read by screen readers? (a) alt (b) height (c) width (d) src
- 12.🔠 How many heading levels does HTML have? (a) 4 (b) 3 (c) 10 (d) 6
-
13.🖼️ How many pixels wide is the picture drawn?
<img src="map.png" alt="Map of India" width="250"> - 14.💬 How does an HTML comment end? (a) >> (b) */ (c) --> (d) //
- 15.📄 Where does the text of <title> appear? (a) at the bottom (b) on the browser tab (c) in a big heading (d) nowhere
- 16.📝 Does <img> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
- 17.🖼️ Which attribute of <img> shows if the image fails? (a) height (b) width (c) alt (d) src
-
18.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Cricket Club</title>
</head>
<body>
<h1>Match report</h1>
<p>Here is my best one.</p>
</body>
</html> (a) Match report (b) Cricket Club (c) body (d) Here is my best one. - 19.🌐 Which one hosts websites online? (a) a web server (b) a web browser (c) a code editor
-
20.🔍 Which line is missing its closing tag?
line 1: <h2>Rain today
line 2: <u>The red kite</u>
line 3: <b>Hello, world!</b> (a) line 3 (b) line 1 (c) line 2 - 21.Which of these goes in the head? (a) <img> (b) <p> (c) <a> (d) <link rel="stylesheet">
- 22.🔤 In “HTML”, what does the L stand for? (a) Laptop (b) Link (c) Line (d) Language
- 23.🔗 What does target="_blank" do to a link? (a) opens it in a new tab (b) makes it blank (c) hides the link (d) makes it bold
- 24.🏷️ Which is the closing tag for <h3>? (a) <\h3> (b) </h3> (c) <h3> (d) <h3/>
- 25.🔢 In a basic web page file, which comes first: “</html>” or “</body>”? (a) </html> (b) </body>
- 26.Which of these is true of a web server? (a) turns HTML into a page (b) is where we type code (c) answers page requests (d) colours code to help us
-
27.📋 What number does the browser show next to “Litchi”?
<ol start="4">
<li>Mango</li>
<li>Litchi</li>
<li>Jamun</li>
<li>Grapes</li>
<li>Orange</li>
<li>Guava</li>
</ol> -
28.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Cricket Club</title>
</head>
<body>
<h1>Welcome!</h1>
<p>I like to read.</p>
</body>
</html> (a) Welcome! (b) body (c) Cricket Club (d) I like to read. - 29.True or false: a web server is where we type code. (a) True (b) False
- 30.🔍 Which is the odd one out? (a) saves our .html files (b) shows line numbers (c) colours code to help us (d) shows pages from the web
- 31.True or false: <ul> is one item of a list. (a) False (b) True
- 32.Which of these is an opening tag? (a) </h1> (b) </li> (c) </p> (d) <p>
-
33.🔗 Which words do you click on?
<a href="news.html">About us</a> (a) news.html (b) href (c) Contact us (d) About us -
34.📋 What number does the browser show next to “Mango”?
<ol start="2">
<li>Papaya</li>
<li>Banana</li>
<li>Mango</li>
<li>Litchi</li>
<li>Orange</li>
</ol> - 35.💬 How does an HTML comment start? (a) <!-- (b) /* (c) # (d) //
- 36.🔢 In a basic web page file, which comes first: “</body>” or “<body>”? (a) <body> (b) </body>
- 37.Which of these has a closing tag? (a) <input> (b) <img> (c) <br> (d) <h1>
- 38.True or false: HTML on its own can make headings. (a) True (b) False
- 39.🌐 Which one turns HTML into a page? (a) a code editor (b) a web server (c) a web browser
- 40.🏷️ Is <body> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
Answer key
- False
- to leave notes
- in the head
- colours code to help us
- a line across the page
- 300
- Fun facts
- <ul>
- <title>
- Maths fun
- alt
- 6
- 250
- -->
- on the browser tab
- an empty tag
- alt
- Match report
- a web server
- line 1
- <link rel="stylesheet">
- Language
- opens it in a new tab
- </h3>
- </body>
- answers page requests
- 5
- Welcome!
- False
- shows pages from the web
- False
- <p>
- About us
- 4
- <!--
- <body>
- <h1>
- True
- a web browser
- an opening tag
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids