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 is the closing tag for <h2>? (a) <\h2> (b) <h2> (c) <h2/> (d) </h2>
- 2.💬 Does the browser show comments on the page? (a) No (b) Yes
- 3.True or false: HTML on its own can add pictures to a page. (a) False (b) True
-
4.🔗 Which address opens when you click this link?
<a href="games.html">School news</a> (a) games.html (b) School news (c) about.html (d) contact.html -
5.🖼️ Which picture file does the browser load?
<img src="dog.jpg" alt="A happy dog" width="350"> (a) A happy dog (b) dog.jpg (c) bus.jpg (d) moon.png -
6.💬 How many paragraphs show on the page?
<p>Cricket is fun.</p>
<p>The red kite</p>
<!-- <p>Rain today</p> --> - 7.🖼️ Does <img> need a closing tag? (a) Yes (b) No
-
8.📝 On how many lines does the browser show this paragraph?
<p>Birds sing<br>Kites fly high</p> -
9.🖼️ Which picture file does the browser load?
<img src="kite.png" alt="A red kite" width="400"> (a) A red kite (b) kite.png (c) cake.jpg (d) map.png - 10.📋 Which list tag is one item of a list? (a) <ul> (b) <ol> (c) <li>
- 11.🔡 Are HTML tag names usually written in small letters? (a) No (b) Yes
-
12.💬 Which text will NOT show on the page?
<p>I love mangoes.</p>
<p>Good morning!</p>
<!-- <p>Fun facts</p> --> (a) I love mangoes. (b) Fun facts (c) Good morning! - 13.🖼️ Why do we add alt text to an image? (a) to colour it (b) to make it bigger (c) to load it faster (d) to describe the image
- 14.True or false: <p> goes in the head. (a) True (b) False
- 15.🏷️ Which is the closing tag for <p>? (a) <p> (b) <p/> (c) <\p> (d) </p>
-
16.💬 Which text will NOT show on the page?
<p>My pets</p>
<p>Good morning!</p>
<!-- <p>Hello, world!</p> --> (a) Hello, world! (b) Good morning! (c) My pets - 17.📄 Can HTML on its own pick a random number? (a) No (b) Yes
- 18.🖼️ Which attribute of <img> sets how tall it is? (a) width (b) height (c) src (d) alt
-
19.🔗 Where does this link open?
<a href="https://example.com" target="_blank">Take the quiz</a> (a) in a new tab (b) in the same tab -
20.🔠 How many headings are in this code?
<h1>I love mangoes.</h1>
<p>Good morning!</p>
<h4>My best friend</h4>
<p>I love mangoes.</p> - 21.🏷️ Every HTML tag starts with which sign? (a) { (b) ( (c) [ (d) <
-
22.📝 How many paragraphs does this code make?
<p>Good morning!</p>
<h2>Good morning!</h2>
<p>I love mangoes.</p>
<p>My best friend</p>
<p>My pets</p> -
23.🔍 One closing tag is missing. Which one?
<strong>Hello, world!</strong>
<u>Cricket is fun.</u>
<i>The red kite (a) </strong> (b) </p> (c) </u> (d) </i> - 24.📄 Where does <style> go: in the head or in the body? (a) in the head (b) in the body
- 25.True or false: in <img>, src sets how wide it is. (a) True (b) False
- 26.True or false: HTML on its own can pick a random number. (a) False (b) True
- 27.💬 How does an HTML comment start? (a) /* (b) <!-- (c) # (d) //
- 28.Which of these is an opening tag? (a) </li> (b) <b> (c) </p> (d) </title>
-
29.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Class 7 Blog</title>
</head>
<body>
<h1>Welcome!</h1>
<p>Try this poha.</p>
</body>
</html> (a) Class 7 Blog (b) body (c) Try this poha. (d) Welcome! - 30.📝 What does <p> make? (a) a table (b) a picture (c) a link (d) a paragraph
- 31.📄 Where does <h1> go: in the head or in the body? (a) in the head (b) in the body
- 32.🖼️ Which attribute of <img> names the picture file? (a) alt (b) height (c) width (d) src
- 33.Which of these is an empty tag? (a) <p> (b) <li> (c) <br> (d) <h1>
- 34.True or false: HTML on its own cannot make links to pages. (a) False (b) True
- 35.Which of these goes in the head? (a) <a> (b) <p> (c) <h1> (d) <meta charset="utf-8">
-
36.🖼️ Which picture file does the browser load?
<img src="fort.jpg" alt="An old fort" width="50"> (a) tiger.jpg (b) fort.jpg (c) An old fort (d) kite.png - 37.True or false: a web server shows pages from the web. (a) True (b) False
- 38.🔠 Which heading shows the BIGGEST text: <h1>, <h3>, <h5> or <h2>? (a) <h1> (b) <h3> (c) <h5> (d) <h2>
-
39.📝 On how many lines does the browser show this paragraph?
<p>Stars shine<br>Kites fly high<br>Rivers flow<br>Sky is blue<br>Birds sing</p> -
40.💬 How many paragraphs show on the page?
<p>Rain today</p>
<p>Our school trip</p>
<!-- <p>Cricket is fun.</p> -->
Answer key
- </h2>
- No
- True
- games.html
- dog.jpg
- 2
- No
- 2
- kite.png
- <li>
- Yes
- Fun facts
- to describe the image
- False
- </p>
- Hello, world!
- No
- height
- in a new tab
- 2
- <
- 4
- </i>
- in the head
- False
- False
- <!--
- <b>
- Welcome!
- a paragraph
- in the body
- src
- <br>
- False
- <meta charset="utf-8">
- fort.jpg
- False
- <h1>
- 5
- 2
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids