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="moon.png" alt="The full moon" width="50"> (a) Our school bus (b) The full moon (c) width (d) moon.png -
2.📋 What number does the browser show next to “Litchi”?
<ol start="4">
<li>Jamun</li>
<li>Litchi</li>
<li>Guava</li>
</ol> -
3.🔠 How many headings are in this code?
<h1>Hello, world!</h1>
<p>My pets</p>
<h4>Our school trip</h4>
<h4>Fun facts</h4>
<h4>I love mangoes.</h4> - 4.Which of these has a closing tag? (a) <br> (b) <p> (c) <input> (d) <img>
- 5.Which of these has a closing tag? (a) <hr> (b) <br> (c) <meta> (d) <h1>
- 6.🔢 In a basic web page file, which comes first: “<body>” or “</head>”? (a) <body> (b) </head>
-
7.🔗 Where does this link open?
<a href="https://example.com">Art corner</a> (a) in the same tab (b) in a new tab -
8.📋 Does this list show bullets or numbers?
<ol>
<li>Mango</li>
<li>Orange</li>
<li>Guava</li>
</ol> (a) numbers (b) bullets - 9.True or false: HTML on its own cannot make bullet lists. (a) False (b) True
- 10.Which of these is a closing tag? (a) <body> (b) <h1> (c) <li> (d) </li>
-
11.💬 Which text will NOT show on the page?
<p>My best friend</p>
<!-- <p>I love mangoes.</p> -->
<p>Hello, world!</p>
<p>The red kite</p> (a) My best friend (b) The red kite (c) I love mangoes. (d) Hello, world! -
12.💬 How many paragraphs show on the page?
<p>Hello, world!</p>
<p>Good morning!</p>
<!-- <p>Cricket is fun.</p> --> -
13.🔗 Which address opens when you click this link?
<a href="maths.html">Take the quiz</a> (a) news.html (b) Take the quiz (c) art.html (d) maths.html - 14.🖼️ Does <img> need a closing tag? (a) Yes (b) No
-
15.📝 How many paragraphs does this code make?
<p>Fun facts</p>
<h2>I love mangoes.</h2>
<p>My pets</p>
<p>My pets</p> -
16.📝 On how many lines does the browser show this paragraph?
<p>Birds sing<br>Kites fly high<br>Sky is blue<br>Roses are red<br>Rivers flow</p> - 17.📝 Does <img> have a closing tag, or is it an empty tag? (a) has a closing tag (b) an empty tag
- 18.📝 Does <b> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
- 19.True or false: in <img>, src sets how tall it is. (a) True (b) False
- 20.🌍 Which program shows a web page to us? (a) a music player (b) a paint program (c) a calculator (d) a web browser
- 21.🔗 Which attribute holds the address of a link? (a) alt (b) id (c) src (d) href
- 22.Which of these is a closing tag? (a) </p> (b) <p> (c) <body> (d) <li>
- 23.📄 Where does <meta charset="utf-8"> go: in the head or in the body? (a) in the head (b) in the body
- 24.True or false: <title> goes in the head. (a) False (b) True
- 25.🏷️ What does a closing tag have that an opening tag does not? (a) a dot . (b) a dollar $ (c) a slash / (d) a hash #
- 26.🖼️ Which attribute of <img> names the picture file? (a) width (b) src (c) height (d) alt
-
27.🖼️ How many pixels wide is the picture drawn?
<img src="cake.jpg" alt="Birthday cake" width="200"> -
28.📋 What number does the browser show next to “Papaya”?
<ol start="7">
<li>Mango</li>
<li>Jamun</li>
<li>Papaya</li>
</ol> -
29.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Space Facts</title>
</head>
<body>
<h1>All about me</h1>
<p>Try this poha.</p>
</body>
</html> (a) Space Facts (b) Try this poha. (c) body (d) All about me - 30.🔍 Which is the odd one out? (a) is where we type code (b) shows line numbers (c) saves our .html files (d) opens web pages for us
-
31.📋 Does this list show bullets or numbers?
<ul>
<li>Banana</li>
<li>Jamun</li>
</ul> (a) bullets (b) numbers -
32.🖼️ How many pixels wide is the picture drawn?
<img src="map.png" alt="Map of India" width="50"> - 33.📄 Which part holds everything you see on the page? (a) the body (b) the head (c) the title (d) the doctype
- 34.🏷️ Is <title> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
-
35.🔍 Which line is missing its closing tag?
line 1: <h2>I love mangoes.</h2>
line 2: <u>My pets</u>
line 3: <h3>Good morning! (a) line 1 (b) line 2 (c) line 3 - 36.🔠 Which heading shows the BIGGEST text: <h5>, <h1>, <h2> or <h3>? (a) <h3> (b) <h1> (c) <h5> (d) <h2>
- 37.🖼️ Which attribute of <img> describes the picture? (a) height (b) alt (c) width (d) src
- 38.📝 What does <br> do? (a) makes text bold (b) adds a picture (c) starts a new line (d) makes a list
-
39.🔗 Where does this link open?
<a href="news.html">Contact us</a> (a) in a new tab (b) in the same tab - 40.🌐 Which one shows line numbers? (a) a web browser (b) a web server (c) a code editor
Answer key
- The full moon
- 5
- 4
- <p>
- <h1>
- </head>
- in the same tab
- numbers
- False
- </li>
- I love mangoes.
- 2
- maths.html
- No
- 3
- 5
- an empty tag
- has a closing tag
- False
- a web browser
- href
- </p>
- in the head
- True
- a slash /
- src
- 200
- 9
- All about me
- opens web pages for us
- bullets
- 50
- the body
- an opening tag
- line 3
- <h1>
- alt
- starts a new line
- in the same tab
- a code editor
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids