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.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="tiger.jpg" alt="A tiger asleep" width="150"> (a) tiger.jpg (b) A red kite (c) width (d) A tiger asleep -
2.🔠 How many headings are in this code?
<h1>Hello, world!</h1>
<h4>My pets</h4>
<h4>My pets</h4>
<h2>Hello, world!</h2>
<h2>Fun facts</h2> - 3.Which of these is an opening tag? (a) <body> (b) </title> (c) </b> (d) </p>
- 4.True or false: HTML on its own can pick a random number. (a) False (b) True
- 5.🖼️ Why do we add alt text to an image? (a) to describe the image (b) to make it bigger (c) to colour it (d) to load it faster
-
6.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Space Facts</title>
</head>
<body>
<h1>Welcome!</h1>
<p>Here is my best one.</p>
</body>
</html> (a) Here is my best one. (b) body (c) Welcome! (d) Space Facts -
7.🔠 How many headings are in this code?
<h1>My pets</h1>
<p>Hello, world!</p>
<h2>My pets</h2>
<p>Rain today</p> -
8.💬 How many paragraphs show on the page?
<!-- <p>Cricket is fun.</p> -->
<p>Good morning!</p>
<p>Rain today</p> - 9.🔗 Which attribute holds the address of a link? (a) alt (b) id (c) href (d) src
- 10.📝 Does <meta> have a closing tag, or is it an empty tag? (a) has a closing tag (b) an empty tag
- 11.🖼️ Does <img> need a closing tag? (a) No (b) Yes
-
12.🔗 Which words do you click on?
<a href="about.html">Play games</a> (a) About us (b) href (c) Play games (d) about.html - 13.📄 Where does <table> go: in the head or in the body? (a) in the body (b) in the head
- 14.💾 A web page file usually ends with which extension? (a) .png (b) .txt (c) .mp3 (d) .html
- 15.True or false: a web browser saves our .html files. (a) True (b) False
- 16.🏷️ Which is the closing tag for <u>? (a) <u> (b) <\u> (c) </u> (d) <u/>
-
17.🔍 One closing tag is missing. Which one?
<u>The red kite
<h3>Rain today</h3>
<h2>Cricket is fun.</h2> (a) </h1> (b) </h2> (c) </h3> (d) </u> -
18.🖼️ Which picture file does the browser load?
<img src="dog.jpg" alt="A happy dog" width="300"> (a) dog.jpg (b) moon.png (c) bus.jpg (d) A happy dog - 19.True or false: <input> has a closing tag. (a) True (b) False
- 20.🔠 Which tag is the least important heading? (a) <h6> (b) <h1> (c) <h3> (d) <p>
-
21.🔍 One closing tag is missing. Which one?
<i>I love mangoes.</i>
<strong>Rain today</strong>
<h3>Good morning! (a) </i> (b) </strong> (c) </h3> (d) </h2> -
22.📋 What number does the browser show next to “Litchi”?
<ol start="8">
<li>Jamun</li>
<li>Papaya</li>
<li>Litchi</li>
<li>Orange</li>
<li>Grapes</li>
</ol> -
23.📋 Does this list show bullets or numbers?
<ul>
<li>Grapes</li>
<li>Mango</li>
<li>Jamun</li>
</ul> (a) numbers (b) bullets - 24.🏷️ Is </li> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
- 25.📝 Does <hr> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
- 26.📄 Which part holds everything you see on the page? (a) the head (b) the doctype (c) the title (d) the body
-
27.📋 How many items does this list show?
<ul>
<li>Guava</li>
<li>Orange</li>
<li>Papaya</li>
<li>Mango</li>
</ul> -
28.🔗 Which words do you click on?
<a href="contact.html">Contact us</a> (a) Visit the site (b) contact.html (c) href (d) Contact us - 29.🔢 In a basic web page file, which comes FIRST? (a) <head> (b) </head> (c) <!DOCTYPE html> (d) <html>
- 30.True or false: in <img>, src names the picture file. (a) False (b) True
-
31.📝 How many paragraphs does this code make?
<p>I love mangoes.</p>
<p>I love mangoes.</p>
<p>Rain today</p> - 32.💬 How does an HTML comment start? (a) <!-- (b) // (c) /* (d) #
- 33.🔡 Are HTML tag names usually written in small letters? (a) No (b) Yes
-
34.💬 How many paragraphs show on the page?
<!-- <p>Cricket is fun.</p> -->
<!-- <p>Hello, world!</p> -->
<!-- <p>The red kite</p> -->
<p>Rain today</p> - 35.True or false: <li> goes inside ul or ol. (a) False (b) True
- 36.📋 Which list shows the steps of a recipe best? (a) <ol> (b) <br> (c) <ul> (d) <hr>
-
37.🔍 Which line is missing its closing tag?
line 1: <h2>Hello, world!</h2>
line 2: <h3>My pets</h3>
line 3: <p>Cricket is fun. (a) line 2 (b) line 1 (c) line 3 - 38.True or false: <table> goes in the body. (a) True (b) False
- 39.True or false: <li> shows bullet points. (a) True (b) False
- 40.🔠 Which heading shows the BIGGEST text: <h1>, <h6>, <h4> or <h3>? (a) <h1> (b) <h3> (c) <h4> (d) <h6>
Answer key
- A tiger asleep
- 5
- <body>
- False
- to describe the image
- Welcome!
- 2
- 2
- href
- an empty tag
- No
- Play games
- in the body
- .html
- False
- </u>
- </u>
- dog.jpg
- False
- <h6>
- </h3>
- 10
- bullets
- a closing tag
- an empty tag
- the body
- 4
- Contact us
- <!DOCTYPE html>
- True
- 3
- <!--
- Yes
- 1
- True
- <ol>
- line 3
- True
- False
- <h1>
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids