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: <ol> is an ordered list. (a) True (b) False
- 2.📝 What does <hr> draw? (a) a link (b) a picture (c) a table (d) a line across the page
- 3.Which of these is an opening tag? (a) <body> (b) </p> (c) </title> (d) </b>
-
4.🔍 Which line is missing its closing tag?
line 1: <h2>I love mangoes.</h2>
line 2: <u>The red kite
line 3: <em>Our school trip</em> (a) line 1 (b) line 3 (c) line 2 -
5.🔗 Where does this link open?
<a href="https://example.com" target="_blank">About us</a> (a) in the same tab (b) in a new tab -
6.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Class 7 Blog</title>
</head>
<body>
<h1>Planets</h1>
<p>Try this poha.</p>
</body>
</html> (a) Class 7 Blog (b) body (c) Try this poha. (d) Planets - 7.🔍 Which is the odd one out? (a) turns HTML into a page (b) is where we type code (c) has an address bar (d) opens web pages for us
- 8.🧩 An opening tag + content + a closing tag together make an ___. (a) element (b) attribute (c) address (d) editor
- 9.🔠 How many heading levels does HTML have? (a) 3 (b) 6 (c) 4 (d) 10
- 10.Which of these has a closing tag? (a) <br> (b) <input> (c) <p> (d) <hr>
- 11.💬 Why do coders write comments? (a) to show pictures (b) to add colour (c) to make links (d) to leave notes
-
12.💬 How many paragraphs show on the page?
<p>My best friend</p>
<!-- <p>Hello, world!</p> -->
<p>Fun facts</p>
<p>I love mangoes.</p>
<!-- <p>Rain today</p> --> -
13.🔗 Where does this link open?
<a href="maths.html" target="_blank">About us</a> (a) in a new tab (b) in the same tab - 14.🔡 Are HTML tag names usually written in small letters? (a) Yes (b) No
-
15.💬 How many paragraphs show on the page?
<p>I love mangoes.</p>
<!-- <p>My best friend</p> -->
<!-- <p>Rain today</p> --> -
16.💬 How many paragraphs show on the page?
<p>My best friend</p>
<!-- <p>Rain today</p> -->
<p>Cricket is fun.</p>
<p>Our school trip</p> - 17.🖼️ Which attribute of <img> describes the picture? (a) alt (b) width (c) height (d) src
- 18.Which of these is an empty tag? (a) <p> (b) <ul> (c) <hr> (d) <title>
- 19.📝 You type 5 spaces between two words in a <p>. How does the browser show them? (a) as a dot (b) as one space (c) as a new line (d) as 5 spaces
- 20.📋 Which list tag is an ordered list? (a) <li> (b) <ul> (c) <ol>
- 21.True or false: <ol> goes inside ul or ol. (a) True (b) False
- 22.📄 Where does <h1> go: in the head or in the body? (a) in the body (b) in the head
- 23.📄 Can HTML on its own make bullet lists? (a) Yes (b) No
- 24.Which of these goes in the head? (a) <p> (b) <h1> (c) <title> (d) <ul>
- 25.📄 Where does the text of <title> appear? (a) at the bottom (b) nowhere (c) on the browser tab (d) in a big heading
- 26.Which of these is true of a web server? (a) is where we type code (b) sends pages over the net (c) shows line numbers (d) colours code to help us
-
27.🔍 One closing tag is missing. Which one?
<small>Rain today</small>
<h1>I love mangoes.
<h2>Good morning!</h2> (a) </small> (b) </h1> (c) </strong> (d) </h2> -
28.💬 How many paragraphs show on the page?
<!-- <p>My best friend</p> -->
<!-- <p>Good morning!</p> -->
<!-- <p>I love mangoes.</p> -->
<p>Our school trip</p>
<!-- <p>Hello, world!</p> --> -
29.🔗 Which words do you click on?
<a href="https://example.com">Maths fun</a> (a) Maths fun (b) href (c) https://example.com (d) Art corner - 30.🔗 What does target="_blank" do to a link? (a) hides the link (b) makes it bold (c) makes it blank (d) opens it in a new tab
-
31.🖼️ Which picture file does the browser load?
<img src="kite.png" alt="A red kite" width="250"> (a) kite.png (b) A red kite (c) map.png (d) cake.jpg - 32.True or false: HTML on its own can run a game loop. (a) True (b) False
- 33.🔠 Which heading shows the BIGGEST text: <h2>, <h5>, <h1> or <h3>? (a) <h5> (b) <h2> (c) <h1> (d) <h3>
- 34.🖼️ Which tag puts a picture on a page? (a) <p> (b) <img> (c) <a> (d) <pic>
-
35.💬 How many paragraphs show on the page?
<!-- <p>I love mangoes.</p> -->
<p>Hello, world!</p>
<p>Good morning!</p>
<p>The red kite</p> -
36.📝 How many paragraphs does this code make?
<p>Hello, world!</p>
<h2>I love mangoes.</h2>
<p>Fun facts</p> - 37.🔠 Which tag is used for the main title on a page? (a) <h6> (b) <h1> (c) <br> (d) <p>
-
38.📝 How many paragraphs does this code make?
<p>Good morning!</p>
<h2>My best friend</h2>
<p>Fun facts</p> -
39.🔍 One closing tag is missing. Which one?
<h3>I love mangoes.</h3>
<b>My pets</b>
<h2>The red kite (a) </strong> (b) </h3> (c) </b> (d) </h2> -
40.🖼️ Which picture file does the browser load?
<img src="fort.jpg" alt="An old fort" width="100"> (a) fort.jpg (b) tiger.jpg (c) kite.png (d) An old fort
Answer key
- True
- a line across the page
- <body>
- line 2
- in a new tab
- Planets
- is where we type code
- element
- 6
- <p>
- to leave notes
- 3
- in a new tab
- Yes
- 1
- 3
- alt
- <hr>
- as one space
- <ol>
- False
- in the body
- Yes
- <title>
- on the browser tab
- sends pages over the net
- </h1>
- 1
- Maths fun
- opens it in a new tab
- kite.png
- False
- <h1>
- <img>
- 3
- 2
- <h1>
- 2
- </h2>
- fort.jpg
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids