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 is the closing tag for <b>? (a) <\b> (b) <b> (c) <b/> (d) </b>
- 2.🔢 In a basic web page file, which comes first: “<body>” or “<!DOCTYPE html>”? (a) <body> (b) <!DOCTYPE html>
-
3.🔠 How many headings are in this code?
<h1>Rain today</h1>
<h2>The red kite</h2>
<p>Rain today</p>
<h4>I love mangoes.</h4>
<h3>Good morning!</h3> - 4.Which of these is an opening tag? (a) </p> (b) <li> (c) </b> (d) </title>
- 5.🖼️ Does <img> need a closing tag? (a) Yes (b) No
- 6.True or false: <ul> shows bullet points. (a) False (b) True
- 7.📄 Where does the text of <title> appear? (a) nowhere (b) on the browser tab (c) in a big heading (d) at the bottom
- 8.🌐 Which one stores a website’s files? (a) a web browser (b) a web server (c) a code editor
- 9.Which of these goes in the head? (a) <h1> (b) <meta charset="utf-8"> (c) <a> (d) <table>
- 10.Which of these is true of a code editor? (a) saves our .html files (b) sends pages over the net (c) turns HTML into a page (d) hosts websites online
- 11.📄 Can HTML on its own make headings? (a) No (b) Yes
-
12.💬 How many paragraphs show on the page?
<p>Rain today</p>
<!-- <p>The red kite</p> -->
<p>Cricket is fun.</p>
<p>Fun facts</p> - 13.📄 Where does <img> go: in the head or in the body? (a) in the body (b) in the head
-
14.🔗 Which words do you click on?
<a href="art.html">School news</a> (a) href (b) Take the quiz (c) School news (d) art.html - 15.📄 Which part holds everything you see on the page? (a) the title (b) the body (c) the doctype (d) the head
- 16.📋 Which tag goes around each item of a list? (a) <ol> (b) <li> (c) <ul> (d) <p>
-
17.🔍 One closing tag is missing. Which one?
<h1>Fun facts</h1>
<u>I love mangoes.</u>
<h3>My best friend (a) </u> (b) </h1> (c) </h2> (d) </h3> - 18.🏷️ What does a closing tag have that an opening tag does not? (a) a dot . (b) a hash # (c) a dollar $ (d) a slash /
- 19.📝 What does <hr> draw? (a) a picture (b) a link (c) a table (d) a line across the page
- 20.True or false: <table> goes in the head. (a) False (b) True
- 21.📝 Does <b> have a closing tag, or is it an empty tag? (a) has a closing tag (b) an empty tag
- 22.🖼️ Which attribute of <img> sets how wide it is? (a) height (b) alt (c) src (d) width
-
23.📋 What number does the browser show next to “Litchi”?
<ol start="3">
<li>Papaya</li>
<li>Litchi</li>
<li>Grapes</li>
<li>Banana</li>
</ol> -
24.🔍 Which line is missing its closing tag?
line 1: <small>The red kite</small>
line 2: <h2>I love mangoes.</h2>
line 3: <i>Hello, world! (a) line 1 (b) line 3 (c) line 2 - 25.🔍 Which is the odd one out? (a) sends pages over the net (b) stores a website’s files (c) colours code to help us (d) answers page requests
- 26.🔠 Which heading shows the BIGGEST text: <h1>, <h5>, <h6> or <h4>? (a) <h6> (b) <h5> (c) <h4> (d) <h1>
-
27.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Space Facts</title>
</head>
<body>
<h1>Easy snacks</h1>
<p>Here is my best one.</p>
</body>
</html> (a) Here is my best one. (b) Easy snacks (c) body (d) Space Facts -
28.🔗 Which address opens when you click this link?
<a href="maths.html">School news</a> (a) art.html (b) School news (c) maths.html (d) news.html - 29.🖼️ Which attribute of <img> sets how tall it is? (a) width (b) height (c) alt (d) src
- 30.True or false: <p> goes in the body. (a) True (b) False
-
31.🔗 Which address opens when you click this link?
<a href="news.html">Maths fun</a> (a) games.html (b) Maths fun (c) news.html (d) quiz.html - 32.📄 Where does <title> go: in the head or in the body? (a) in the head (b) in the body
- 33.🖼️ Why do we add alt text to an image? (a) to make it bigger (b) to describe the image (c) to colour it (d) to load it faster
- 34.True or false: in <img>, width sets how tall it is. (a) True (b) False
-
35.💬 How many paragraphs show on the page?
<p>Good morning!</p>
<!-- <p>Hello, world!</p> -->
<p>Rain today</p>
<p>The red kite</p>
<p>My pets</p> -
36.🔍 One closing tag is missing. Which one?
<strong>My pets</strong>
<em>I love mangoes.</em>
<b>Cricket is fun. (a) </strong> (b) </b> (c) </em> (d) </small> - 37.📝 You type 5 spaces between two words in a <p>. How does the browser show them? (a) as 5 spaces (b) as a new line (c) as one space (d) as a dot
- 38.📋 Which list suits a shopping list in any order? (a) <br> (b) <hr> (c) <ol> (d) <ul>
- 39.True or false: <ul> is an empty tag. (a) False (b) True
- 40.True or false: <ol> lists steps in order. (a) True (b) False
Answer key
- </b>
- <!DOCTYPE html>
- 4
- <li>
- No
- True
- on the browser tab
- a web server
- <meta charset="utf-8">
- saves our .html files
- Yes
- 3
- in the body
- School news
- the body
- <li>
- </h3>
- a slash /
- a line across the page
- False
- has a closing tag
- width
- 4
- line 3
- colours code to help us
- <h1>
- Easy snacks
- maths.html
- height
- True
- news.html
- in the head
- to describe the image
- False
- 4
- </b>
- as one space
- <ul>
- False
- True
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids