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 attribute holds the address of a link? (a) src (b) href (c) id (d) alt
-
2.💬 Which text will NOT show on the page?
<p>The red kite</p>
<!-- <p>Rain today</p> -->
<p>Our school trip</p> (a) Our school trip (b) Rain today (c) The red kite -
3.📋 How many items does this list show?
<ul>
<li>Orange</li>
<li>Papaya</li>
<li>Guava</li>
<li>Banana</li>
</ul> -
4.🖼️ How many pixels wide is the picture drawn?
<img src="dog.jpg" alt="A happy dog" width="150"> -
5.🔠 How many headings are in this code?
<h1>Good morning!</h1>
<p>Our school trip</p>
<h2>My best friend</h2> - 6.Which of these goes in the body? (a) <title> (b) <link rel="stylesheet"> (c) <h1> (d) <meta charset="utf-8">
-
7.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="kite.png" alt="A red kite" width="50"> (a) A red kite (b) kite.png (c) width (d) Map of India - 8.💬 How does an HTML comment end? (a) */ (b) --> (c) >> (d) //
-
9.📝 On how many lines does the browser show this paragraph?
<p>Sky is blue<br>Birds sing</p> -
10.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Art Gallery</title>
</head>
<body>
<h1>All about me</h1>
<p>Thanks for visiting.</p>
</body>
</html> (a) Thanks for visiting. (b) body (c) Art Gallery (d) All about me -
11.🖼️ Which picture file does the browser load?
<img src="bus.jpg" alt="Our school bus" width="200"> (a) tiger.jpg (b) Our school bus (c) fort.jpg (d) bus.jpg - 12.🏷️ Is <li> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
- 13.True or false: <style> goes in the body. (a) False (b) True
-
14.💬 Which text will NOT show on the page?
<p>Our school trip</p>
<p>Cricket is fun.</p>
<!-- <p>Fun facts</p> --> (a) Our school trip (b) Fun facts (c) Cricket is fun. -
15.📋 How many items does this list show?
<ul>
<li>Banana</li>
<li>Orange</li>
</ul> - 16.True or false: <ul> goes in the head. (a) True (b) False
- 17.📝 Does <b> have a closing tag, or is it an empty tag? (a) has a closing tag (b) an empty tag
-
18.🔍 Which line is missing its closing tag?
line 1: <h2>Hello, world!</h2>
line 2: <h3>Cricket is fun.
line 3: <b>Fun facts</b> (a) line 1 (b) line 3 (c) line 2 - 19.🌐 Which one colours code to help us? (a) a code editor (b) a web browser (c) a web server
- 20.🏷️ Is <h1> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
-
21.🔗 Which address opens when you click this link?
<a href="https://example.com">About us</a> (a) maths.html (b) art.html (c) About us (d) https://example.com - 22.True or false: in <img>, src shows if the image fails. (a) False (b) True
- 23.Which of these is an opening tag? (a) </p> (b) </body> (c) </h1> (d) <body>
-
24.🔗 Which address opens when you click this link?
<a href="contact.html">About us</a> (a) contact.html (b) maths.html (c) https://example.com (d) About us - 25.🖼️ Why do we add alt text to an image? (a) to make it bigger (b) to colour it (c) to load it faster (d) to describe the image
- 26.🔠 Are headings shown in bold by default? (a) No (b) Yes
-
27.📋 Does this list show bullets or numbers?
<ul>
<li>Banana</li>
<li>Jamun</li>
</ul> (a) bullets (b) numbers -
28.🖼️ How many pixels wide is the picture drawn?
<img src="moon.png" alt="The full moon" width="250"> - 29.🏷️ HTML marks up text using ___. (a) keys (b) pixels (c) tags (d) wires
- 30.Which of these is a closing tag? (a) <p> (b) <title> (c) <h1> (d) </h1>
- 31.🔡 Are HTML tag names usually written in small letters? (a) No (b) Yes
- 32.💬 Why do coders write comments? (a) to add colour (b) to make links (c) to show pictures (d) to leave notes
- 33.📄 Where does <a> go: in the head or in the body? (a) in the body (b) in the head
- 34.🌐 Which one turns HTML into a page? (a) a code editor (b) a web server (c) a web browser
- 35.Which of these is a closing tag? (a) <li> (b) <h1> (c) <p> (d) </title>
-
36.🖼️ Which picture file does the browser load?
<img src="kite.png" alt="A red kite" width="300"> (a) cake.jpg (b) map.png (c) kite.png (d) A red kite - 37.📄 Where does the text of <title> appear? (a) in a big heading (b) at the bottom (c) nowhere (d) on the browser tab
- 38.True or false: <input> is an empty tag. (a) True (b) False
- 39.📝 Does <input> have a closing tag, or is it an empty tag? (a) has a closing tag (b) an empty tag
- 40.🔠 Which tag is the least important heading? (a) <h1> (b) <p> (c) <h6> (d) <h3>
Answer key
- href
- Rain today
- 4
- 150
- 2
- <h1>
- A red kite
- -->
- 2
- All about me
- bus.jpg
- an opening tag
- False
- Fun facts
- 2
- False
- has a closing tag
- line 2
- a code editor
- an opening tag
- https://example.com
- False
- <body>
- contact.html
- to describe the image
- Yes
- bullets
- 250
- tags
- </h1>
- Yes
- to leave notes
- in the body
- a web browser
- </title>
- kite.png
- on the browser tab
- True
- an empty tag
- <h6>
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids