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: <h1> goes in the head. (a) False (b) True
- 2.🏷️ Which is the closing tag for <h1>? (a) <\h1> (b) </h1> (c) <h1/> (d) <h1>
- 3.📄 What is the first line of an HTML5 page? (a) <!DOCTYPE html> (b) <body> (c) <head> (d) <html>
- 4.💬 How does an HTML comment start? (a) <!-- (b) // (c) # (d) /*
-
5.📝 On how many lines does the browser show this paragraph?
<p>Rivers flow<br>Roses are red<br>Sky is blue<br>Stars shine</p> -
6.📝 On how many lines does the browser show this paragraph?
<p>Sky is blue<br>Birds sing<br>Rivers flow<br>Stars shine</p> - 7.💬 Why do coders write comments? (a) to add colour (b) to leave notes (c) to show pictures (d) to make links
- 8.🧩 An opening tag + content + a closing tag together make an ___. (a) element (b) attribute (c) address (d) editor
-
9.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>Space Facts</title>
</head>
<body>
<h1>My drawings</h1>
<p>Mars is red.</p>
</body>
</html> (a) Space Facts (b) My drawings (c) Mars is red. (d) index.html - 10.📄 Can HTML on its own make bullet lists? (a) Yes (b) No
- 11.True or false: <h1> is an empty tag. (a) True (b) False
-
12.🔗 Where does this link open?
<a href="art.html">Visit the site</a> (a) in a new tab (b) in the same tab - 13.True or false: in <img>, alt describes the picture. (a) False (b) True
- 14.📋 Which list tag is one item of a list? (a) <li> (b) <ul> (c) <ol>
-
15.💬 Which text will NOT show on the page?
<p>Hello, world!</p>
<!-- <p>The red kite</p> -->
<p>Our school trip</p>
<p>My best friend</p> (a) Hello, world! (b) My best friend (c) Our school trip (d) The red kite -
16.📝 How many paragraphs does this code make?
<p>Hello, world!</p>
<p>Fun facts</p>
<h2>Cricket is fun.</h2>
<p>Good morning!</p> - 17.Which of these is an opening tag? (a) </p> (b) </li> (c) <b> (d) </b>
- 18.Which of these is a closing tag? (a) </h1> (b) <body> (c) <title> (d) <p>
-
19.🔍 One closing tag is missing. Which one?
<p>Fun facts</p>
<small>I love mangoes.
<strong>Our school trip</strong> (a) </small> (b) </p> (c) </strong> (d) </h1> -
20.🔍 Which line is missing its closing tag?
line 1: <h3>Good morning!</h3>
line 2: <em>My best friend
line 3: <small>Hello, world!</small> (a) line 3 (b) line 2 (c) line 1 - 21.🌐 Which one stores a website’s files? (a) a code editor (b) a web server (c) a web browser
- 22.🔗 Which attribute holds the address of a link? (a) alt (b) src (c) id (d) href
- 23.🔠 Which heading shows the SMALLEST text: <h5>, <h3>, <h1> or <h4>? (a) <h5> (b) <h1> (c) <h4> (d) <h3>
- 24.Which of these is true of a code editor? (a) shows line numbers (b) shows pages from the web (c) sends pages over the net (d) opens web pages for us
- 25.True or false: <ul> is an empty tag. (a) True (b) False
- 26.🔡 Are HTML tag names usually written in small letters? (a) No (b) Yes
-
27.💬 How many paragraphs show on the page?
<!-- <p>Cricket is fun.</p> -->
<p>Rain today</p>
<p>My pets</p>
<p>Fun facts</p> - 28.Which of these goes in the body? (a) <h1> (b) <title> (c) <meta charset="utf-8"> (d) <style>
-
29.🔗 Where does this link open?
<a href="about.html">About us</a> (a) in the same tab (b) in a new tab - 30.True or false: in <img>, src sets how wide it is. (a) False (b) True
-
31.🔗 Which address opens when you click this link?
<a href="about.html">Take the quiz</a> (a) https://example.com (b) Take the quiz (c) about.html (d) contact.html - 32.True or false: <ul> goes inside ul or ol. (a) True (b) False
-
33.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="tiger.jpg" alt="A tiger asleep" width="400"> (a) A tiger asleep (b) width (c) tiger.jpg (d) A red kite - 34.📋 Which tag goes around each item of a list? (a) <li> (b) <ol> (c) <p> (d) <ul>
-
35.🔗 Which address opens when you click this link?
<a href="art.html">Art corner</a> (a) art.html (b) Art corner (c) quiz.html (d) news.html - 36.True or false: <ol> shows bullet points. (a) False (b) True
-
37.🖼️ Which picture file does the browser load?
<img src="tiger.jpg" alt="A tiger asleep" width="350"> (a) kite.png (b) A tiger asleep (c) map.png (d) tiger.jpg -
38.🔗 Which words do you click on?
<a href="games.html">Visit the site</a> (a) href (b) Maths fun (c) Visit the site (d) games.html - 39.True or false: <h1> goes in the body. (a) True (b) False
-
40.📋 How many items does this list show?
<ul>
<li>Jamun</li>
<li>Banana</li>
<li>Mango</li>
<li>Orange</li>
</ul>
Answer key
- False
- </h1>
- <!DOCTYPE html>
- <!--
- 4
- 4
- to leave notes
- element
- Space Facts
- Yes
- False
- in the same tab
- True
- <li>
- The red kite
- 3
- <b>
- </h1>
- </small>
- line 2
- a web server
- href
- <h5>
- shows line numbers
- False
- Yes
- 3
- <h1>
- in the same tab
- False
- about.html
- False
- A tiger asleep
- <li>
- art.html
- False
- tiger.jpg
- Visit the site
- True
- 4
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids