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.True or false: in <img>, alt shows if the image fails. (a) True (b) False
- 2.Which of these is a closing tag? (a) <p> (b) </h1> (c) <h1> (d) <body>
-
3.💬 Which text will NOT show on the page?
<!-- <p>Cricket is fun.</p> -->
<p>The red kite</p>
<p>I love mangoes.</p> (a) I love mangoes. (b) Cricket is fun. (c) The red kite - 4.📝 What does <p> make? (a) a paragraph (b) a link (c) a table (d) a picture
-
5.📝 How many paragraphs does this code make?
<p>Rain today</p>
<p>Our school trip</p>
<p>Rain today</p>
<p>The red kite</p> - 6.🖼️ Why do we add alt text to an image? (a) to colour it (b) to describe the image (c) to make it bigger (d) to load it faster
-
7.🖼️ 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 -
8.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>Space Facts</title>
</head>
<body>
<h1>Match report</h1>
<p>Mars is red.</p>
</body>
</html> (a) Mars is red. (b) index.html (c) Match report (d) Space Facts -
9.🔍 One closing tag is missing. Which one?
<strong>My best friend</strong>
<h3>My pets
<b>Good morning!</b> (a) </h3> (b) </strong> (c) </p> (d) </b> - 10.🔠 Which heading shows the BIGGEST text: <h5>, <h1>, <h3> or <h6>? (a) <h6> (b) <h1> (c) <h3> (d) <h5>
- 11.📝 You type 5 spaces between two words in a <p>. How does the browser show them? (a) as a dot (b) as 5 spaces (c) as one space (d) as a new line
- 12.📄 Can HTML on its own make tables? (a) No (b) Yes
- 13.🔢 In a basic web page file, which comes LAST? (a) <!DOCTYPE html> (b) <body> (c) <head> (d) </html>
- 14.True or false: <li> is one item of a list. (a) False (b) True
- 15.True or false: a code editor is where we type code. (a) False (b) True
- 16.🔠 Which heading shows the BIGGEST text: <h3>, <h1>, <h2> or <h4>? (a) <h3> (b) <h1> (c) <h4> (d) <h2>
- 17.Which of these is a closing tag? (a) <b> (b) <body> (c) </b> (d) <li>
- 18.🧩 An opening tag + content + a closing tag together make an ___. (a) attribute (b) address (c) element (d) editor
-
19.🔍 Which line is missing its closing tag?
line 1: <u>The red kite</u>
line 2: <i>Our school trip</i>
line 3: <em>Rain today (a) line 3 (b) line 1 (c) line 2 -
20.🔠 How many headings are in this code?
<h1>My pets</h1>
<p>Cricket is fun.</p>
<p>I love mangoes.</p> -
21.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Class 7 Blog</title>
</head>
<body>
<h1>Planets</h1>
<p>Here is my best one.</p>
</body>
</html> (a) Class 7 Blog (b) body (c) Here is my best one. (d) Planets - 22.True or false: HTML on its own cannot make bullet lists. (a) False (b) True
- 23.🌐 Which one saves our .html files? (a) a web server (b) a web browser (c) a code editor
-
24.💬 How many paragraphs show on the page?
<!-- <p>Rain today</p> -->
<p>Fun facts</p>
<p>Good morning!</p>
<!-- <p>Hello, world!</p> --> - 25.🔍 Which is the odd one out? (a) stores a website’s files (b) answers page requests (c) hosts websites online (d) colours code to help us
- 26.True or false: a web server sends pages over the net. (a) True (b) False
- 27.Which of these goes in the head? (a) <title> (b) <p> (c) <table> (d) <h1>
- 28.💬 How does an HTML comment end? (a) --> (b) >> (c) // (d) */
- 29.📋 Which tag goes around each item of a list? (a) <p> (b) <ul> (c) <li> (d) <ol>
-
30.📝 How many paragraphs does this code make?
<p>My pets</p>
<h2>The red kite</h2>
<h2>Our school trip</h2>
<p>Our school trip</p>
<h2>Good morning!</h2>
<h2>Fun facts</h2> - 31.True or false: a web server has an address bar. (a) False (b) True
-
32.💬 How many paragraphs show on the page?
<p>Hello, world!</p>
<!-- <p>My best friend</p> -->
<p>Fun facts</p>
<p>I love mangoes.</p>
<p>The red kite</p> - 33.💬 Can anyone read your comments by viewing the page source? (a) No (b) Yes
-
34.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>Class 7 Blog</title>
</head>
<body>
<h1>Easy snacks</h1>
<p>We won by 5 runs.</p>
</body>
</html> (a) index.html (b) Class 7 Blog (c) Easy snacks (d) We won by 5 runs. -
35.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="moon.png" alt="The full moon" width="300"> (a) width (b) The full moon (c) moon.png (d) Our school bus - 36.🔗 Which attribute holds the address of a link? (a) alt (b) id (c) href (d) src
- 37.True or false: <p> is an empty tag. (a) True (b) False
- 38.🔠 Which heading shows the SMALLEST text: <h2>, <h5>, <h1> or <h6>? (a) <h5> (b) <h6> (c) <h1> (d) <h2>
-
39.🔍 One closing tag is missing. Which one?
<em>My best friend</em>
<p>My pets</p>
<b>I love mangoes. (a) </em> (b) </b> (c) </p> (d) </h1> - 40.🌐 Which one shows pages from the web? (a) a web server (b) a web browser (c) a code editor
Answer key
- True
- </h1>
- Cricket is fun.
- a paragraph
- 4
- to describe the image
- dog.jpg
- Space Facts
- </h3>
- <h1>
- as one space
- Yes
- </html>
- True
- True
- <h1>
- </b>
- element
- line 3
- 1
- Planets
- False
- a code editor
- 2
- colours code to help us
- True
- <title>
- -->
- <li>
- 2
- False
- 4
- Yes
- Class 7 Blog
- The full moon
- href
- False
- <h6>
- </b>
- a web browser
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids