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.🔗 Where does this link open?
<a href="https://example.com">Visit the site</a> (a) in a new tab (b) in the same tab - 2.True or false: <h1> has a closing tag. (a) True (b) False
- 3.📄 Where does the text of <title> appear? (a) in a big heading (b) at the bottom (c) on the browser tab (d) nowhere
-
4.📝 On how many lines does the browser show this paragraph?
<p>Birds sing<br>Roses are red<br>Sky is blue<br>Stars shine</p> - 5.True or false: <a> goes in the head. (a) False (b) True
-
6.🔗 Which address opens when you click this link?
<a href="games.html">Maths fun</a> (a) about.html (b) Maths fun (c) games.html (d) contact.html -
7.🔍 Which line is missing its closing tag?
line 1: <h2>Rain today
line 2: <i>Hello, world!</i>
line 3: <small>Our school trip</small> (a) line 1 (b) line 3 (c) line 2 - 8.💬 How does an HTML comment end? (a) >> (b) // (c) --> (d) */
- 9.🔠 Which heading shows the SMALLEST text: <h3>, <h4>, <h1> or <h2>? (a) <h1> (b) <h3> (c) <h2> (d) <h4>
-
10.💬 How many paragraphs show on the page?
<!-- <p>Cricket is fun.</p> -->
<p>My pets</p>
<!-- <p>My best friend</p> -->
<!-- <p>The red kite</p> --> - 11.Which of these has a closing tag? (a) <ul> (b) <br> (c) <meta> (d) <hr>
- 12.🏷️ Is <title> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
-
13.📝 How many paragraphs does this code make?
<p>Hello, world!</p>
<h2>The red kite</h2>
<h2>The red kite</h2>
<p>Rain today</p> - 14.🔠 Which tag is the least important heading? (a) <h6> (b) <h3> (c) <p> (d) <h1>
-
15.📝 How many paragraphs does this code make?
<p>Cricket is fun.</p>
<h2>Our school trip</h2>
<p>Fun facts</p>
<p>My pets</p>
<h2>I love mangoes.</h2>
<h2>Good morning!</h2> - 16.Which of these is an empty tag? (a) <ul> (b) <meta> (c) <title> (d) <li>
-
17.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>Class 7 Blog</title>
</head>
<body>
<h1>Planets</h1>
<p>I like to read.</p>
</body>
</html> (a) index.html (b) Planets (c) Class 7 Blog (d) I like to read. - 18.True or false: <hr> is an empty tag. (a) False (b) True
- 19.True or false: in <img>, src names the picture file. (a) True (b) False
-
20.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>Cricket Club</title>
</head>
<body>
<h1>Match report</h1>
<p>Try this poha.</p>
</body>
</html> (a) index.html (b) Try this poha. (c) Match report (d) Cricket Club - 21.🖼️ Which attribute of <img> names the picture file? (a) src (b) height (c) width (d) alt
- 22.True or false: in <img>, alt describes the picture. (a) True (b) False
- 23.🔠 Which heading shows the SMALLEST text: <h5>, <h6>, <h3> or <h2>? (a) <h5> (b) <h6> (c) <h2> (d) <h3>
- 24.🖼️ Which attribute of <img> sets how wide it is? (a) height (b) alt (c) src (d) width
- 25.📋 Which list suits a shopping list in any order? (a) <ol> (b) <hr> (c) <br> (d) <ul>
- 26.📝 Does <hr> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
-
27.🔠 How many headings are in this code?
<h1>My best friend</h1>
<h4>Hello, world!</h4>
<p>Good morning!</p>
<h2>Good morning!</h2> -
28.🖼️ Which picture file does the browser load?
<img src="map.png" alt="Map of India" width="200"> (a) dog.jpg (b) cake.jpg (c) Map of India (d) map.png -
29.💬 How many paragraphs show on the page?
<p>I love mangoes.</p>
<p>My pets</p>
<p>My best friend</p>
<!-- <p>Fun facts</p> -->
<p>Cricket is fun.</p> -
30.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="cake.jpg" alt="Birthday cake" width="400"> (a) width (b) Birthday cake (c) cake.jpg (d) A happy dog - 31.True or false: HTML on its own can pick a random number. (a) True (b) False
- 32.💬 How does an HTML comment start? (a) # (b) // (c) /* (d) <!--
-
33.🖼️ Which picture file does the browser load?
<img src="bus.jpg" alt="Our school bus" width="350"> (a) Our school bus (b) tiger.jpg (c) bus.jpg (d) fort.jpg -
34.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="bus.jpg" alt="Our school bus" width="250"> (a) width (b) bus.jpg (c) Our school bus (d) An old fort - 35.📝 Does <li> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
-
36.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="cake.jpg" alt="Birthday cake" width="300"> (a) cake.jpg (b) width (c) A happy dog (d) Birthday cake - 37.True or false: <ul> is an unordered list. (a) False (b) True
- 38.True or false: <img> goes in the head. (a) False (b) True
- 39.🔠 How many <h1> headings should a page usually have? (a) 1 (b) 3 (c) 6 (d) 10
- 40.🔠 Which heading shows the BIGGEST text: <h6>, <h1>, <h2> or <h4>? (a) <h4> (b) <h2> (c) <h6> (d) <h1>
Answer key
- in the same tab
- True
- on the browser tab
- 4
- False
- games.html
- line 1
- -->
- <h4>
- 1
- <ul>
- an opening tag
- 2
- <h6>
- 3
- <meta>
- Class 7 Blog
- True
- True
- Cricket Club
- src
- True
- <h6>
- width
- <ul>
- an empty tag
- 3
- map.png
- 4
- Birthday cake
- False
- <!--
- bus.jpg
- Our school bus
- has a closing tag
- Birthday cake
- True
- False
- 1
- <h1>
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids