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.💬 How does an HTML comment start? (a) <!-- (b) # (c) /* (d) //
- 2.True or false: <b> has a closing tag. (a) True (b) False
-
3.🔍 Which line is missing its closing tag?
line 1: <strong>My pets
line 2: <h3>Fun facts</h3>
line 3: <h1>The red kite</h1> (a) line 3 (b) line 2 (c) line 1 -
4.🔗 Which address opens when you click this link?
<a href="quiz.html">About us</a> (a) about.html (b) quiz.html (c) About us (d) games.html - 5.🔗 Which tag makes a clickable link? (a) <p> (b) <img> (c) <a> (d) <link>
-
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>Thanks for visiting.</p>
</body>
</html> (a) Class 7 Blog (b) Thanks for visiting. (c) Planets (d) body - 7.🔠 Which heading shows the SMALLEST text: <h6>, <h5>, <h2> or <h1>? (a) <h5> (b) <h2> (c) <h1> (d) <h6>
-
8.🖼️ Which picture file does the browser load?
<img src="dog.jpg" alt="A happy dog" width="100"> (a) moon.png (b) A happy dog (c) dog.jpg (d) bus.jpg - 9.🔍 Which is the odd one out? (a) shows line numbers (b) is where we type code (c) hosts websites online (d) saves our .html files
-
10.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>Riya’s Recipes</title>
</head>
<body>
<h1>Welcome!</h1>
<p>Here is my best one.</p>
</body>
</html> (a) Riya’s Recipes (b) index.html (c) Welcome! (d) Here is my best one. - 11.🔠 Which tag is used for the main title on a page? (a) <h1> (b) <p> (c) <br> (d) <h6>
-
12.🔠 How many headings are in this code?
<h1>My best friend</h1>
<p>I love mangoes.</p>
<h3>Fun facts</h3>
<p>Fun facts</p> - 13.True or false: in <img>, height describes the picture. (a) True (b) False
- 14.🖼️ Which attribute of <img> is read by screen readers? (a) height (b) src (c) width (d) alt
- 15.True or false: <meta charset="utf-8"> goes in the body. (a) False (b) True
- 16.🖼️ Which tag puts a picture on a page? (a) <pic> (b) <a> (c) <p> (d) <img>
-
17.🔗 Where does this link open?
<a href="art.html" target="_blank">Contact us</a> (a) in the same tab (b) in a new tab - 18.True or false: <li> is an unordered list. (a) True (b) False
- 19.📄 Where does <meta charset="utf-8"> go: in the head or in the body? (a) in the head (b) in the body
-
20.💬 How many paragraphs show on the page?
<!-- <p>Good morning!</p> -->
<p>My pets</p>
<p>Rain today</p>
<p>Cricket is fun.</p> - 21.Which of these goes in the head? (a) <img> (b) <a> (c) <style> (d) <ul>
-
22.💬 How many paragraphs show on the page?
<!-- <p>My pets</p> -->
<!-- <p>I love mangoes.</p> -->
<p>Hello, world!</p> -
23.🔍 Which line is missing its closing tag?
line 1: <p>Fun facts
line 2: <small>My pets</small>
line 3: <strong>My best friend</strong> (a) line 1 (b) line 3 (c) line 2 - 24.🧩 An opening tag + content + a closing tag together make an ___. (a) address (b) element (c) editor (d) attribute
-
25.📋 Does this list show bullets or numbers?
<ul>
<li>Mango</li>
<li>Grapes</li>
</ul> (a) numbers (b) bullets -
26.📋 Does this list show bullets or numbers?
<ol>
<li>Papaya</li>
<li>Litchi</li>
</ol> (a) bullets (b) numbers - 27.🔠 Which heading shows the SMALLEST text: <h4>, <h6>, <h5> or <h2>? (a) <h5> (b) <h4> (c) <h2> (d) <h6>
-
28.💬 Which text will NOT show on the page?
<p>My pets</p>
<p>Fun facts</p>
<!-- <p>I love mangoes.</p> --> (a) My pets (b) Fun facts (c) I love mangoes. - 29.Which of these is an opening tag? (a) </title> (b) <li> (c) </b> (d) </body>
- 30.🔠 Which heading shows the SMALLEST text: <h2>, <h6>, <h1> or <h3>? (a) <h2> (b) <h1> (c) <h6> (d) <h3>
- 31.💬 How does an HTML comment end? (a) */ (b) // (c) >> (d) -->
- 32.🔠 Which heading shows the BIGGEST text: <h4>, <h6>, <h3> or <h5>? (a) <h3> (b) <h6> (c) <h5> (d) <h4>
-
33.🖼️ Which picture file does the browser load?
<img src="bus.jpg" alt="Our school bus" width="50"> (a) fort.jpg (b) tiger.jpg (c) Our school bus (d) bus.jpg - 34.True or false: <title> has a closing tag. (a) True (b) False
-
35.🔍 One closing tag is missing. Which one?
<small>Hello, world!</small>
<strong>Our school trip
<b>Cricket is fun.</b> (a) </u> (b) </b> (c) </small> (d) </strong> - 36.🔗 What does HyperText mean? (a) secret text (b) text with links (c) very big text (d) text in colour
- 37.🏷️ Which is the closing tag for <h3>? (a) <h3/> (b) </h3> (c) <\h3> (d) <h3>
- 38.🖼️ Which attribute of <img> sets how wide it is? (a) src (b) width (c) height (d) alt
- 39.🏷️ Is </li> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
- 40.🔠 Which heading shows the BIGGEST text: <h6>, <h2>, <h1> or <h3>? (a) <h2> (b) <h1> (c) <h6> (d) <h3>
Answer key
- <!--
- True
- line 1
- quiz.html
- <a>
- Planets
- <h6>
- dog.jpg
- hosts websites online
- Riya’s Recipes
- <h1>
- 2
- False
- alt
- False
- <img>
- in a new tab
- False
- in the head
- 3
- <style>
- 1
- line 1
- element
- bullets
- numbers
- <h6>
- I love mangoes.
- <li>
- <h6>
- -->
- <h3>
- bus.jpg
- True
- </strong>
- text with links
- </h3>
- width
- a closing tag
- <h1>
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids