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.💬 Why do coders write comments? (a) to show pictures (b) to add colour (c) to make links (d) to leave notes
- 2.True or false: <ul> lists steps in order. (a) False (b) True
- 3.True or false: <h1> goes in the body. (a) False (b) True
-
4.🔍 One closing tag is missing. Which one?
<p>Our school trip</p>
<u>My best friend</u>
<h2>Hello, world! (a) </p> (b) </small> (c) </h2> (d) </u> - 5.📋 Which list tag shows bullet points? (a) <li> (b) <ol> (c) <ul>
- 6.🔢 In a basic web page file, which comes first: “</body>” or “<html>”? (a) </body> (b) <html>
- 7.Which of these is a closing tag? (a) <b> (b) <li> (c) </li> (d) <title>
- 8.Which of these is true of a web server? (a) turns HTML into a page (b) stores a website’s files (c) opens web pages for us (d) is where we type code
- 9.🖼️ Which attribute of <img> sets how tall it is? (a) height (b) width (c) alt (d) src
- 10.🔢 In a basic web page file, which comes FIRST? (a) <!DOCTYPE html> (b) </body> (c) <body> (d) <head>
-
11.📋 How many items does this list show?
<ol>
<li>Banana</li>
<li>Jamun</li>
<li>Guava</li>
<li>Grapes</li>
</ol> - 12.📋 Which list tag lists things in any order? (a) <li> (b) <ul> (c) <ol>
- 13.True or false: a web server hosts websites online. (a) False (b) True
-
14.🔠 How many headings are in this code?
<h1>I love mangoes.</h1>
<p>Cricket is fun.</p>
<h2>Cricket is fun.</h2>
<p>My best friend</p>
<h4>Fun facts</h4> - 15.True or false: <ul> goes inside ul or ol. (a) True (b) False
- 16.🔠 Which heading shows the SMALLEST text: <h4>, <h1>, <h2> or <h3>? (a) <h4> (b) <h2> (c) <h1> (d) <h3>
- 17.Which of these is an opening tag? (a) </p> (b) <body> (c) </li> (d) </title>
-
18.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Space Facts</title>
</head>
<body>
<h1>Easy snacks</h1>
<p>I like to read.</p>
</body>
</html> (a) Space Facts (b) I like to read. (c) body (d) Easy snacks - 19.💬 How does an HTML comment start? (a) # (b) /* (c) // (d) <!--
- 20.📝 Does <input> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
-
21.🔗 Which address opens when you click this link?
<a href="games.html">Maths fun</a> (a) Maths fun (b) contact.html (c) games.html (d) about.html -
22.📝 How many paragraphs does this code make?
<p>My best friend</p>
<h2>Fun facts</h2>
<h2>Cricket is fun.</h2>
<h2>Hello, world!</h2> - 23.Which of these is a closing tag? (a) <li> (b) <p> (c) </h1> (d) <body>
- 24.🏷️ Is <h1> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
- 25.Which of these is a closing tag? (a) </title> (b) <b> (c) <p> (d) <title>
- 26.🔠 How many heading levels does HTML have? (a) 10 (b) 4 (c) 3 (d) 6
-
27.🖼️ Which picture file does the browser load?
<img src="dog.jpg" alt="A happy dog" width="250"> (a) bus.jpg (b) dog.jpg (c) A happy dog (d) moon.png -
28.🔗 Which words do you click on?
<a href="about.html">Visit the site</a> (a) Visit the site (b) Maths fun (c) href (d) about.html -
29.📋 What number does the browser show next to “Banana”?
<ol start="6">
<li>Guava</li>
<li>Orange</li>
<li>Banana</li>
</ol> - 30.🌐 Which one is where we type code? (a) a code editor (b) a web server (c) a web browser
- 31.📝 What does <br> do? (a) adds a picture (b) makes text bold (c) makes a list (d) starts a new line
-
32.💬 How many paragraphs show on the page?
<p>Fun facts</p>
<!-- <p>My pets</p> -->
<p>The red kite</p>
<p>My best friend</p> -
33.🔗 Which words do you click on?
<a href="maths.html">About us</a> (a) href (b) maths.html (c) About us (d) Contact us - 34.Which of these goes in the head? (a) <h1> (b) <p> (c) <table> (d) <meta charset="utf-8">
- 35.🔠 Which heading shows the SMALLEST text: <h1>, <h5>, <h4> or <h3>? (a) <h5> (b) <h1> (c) <h4> (d) <h3>
-
36.🔗 Which address opens when you click this link?
<a href="maths.html">Play games</a> (a) art.html (b) maths.html (c) news.html (d) Play games -
37.💬 How many paragraphs show on the page?
<!-- <p>Cricket is fun.</p> -->
<p>Our school trip</p>
<p>Rain today</p>
<!-- <p>Hello, world!</p> -->
<!-- <p>My best friend</p> --> - 38.📛 In <a href="x.html">, what is href? (a) an element name (b) an attribute (c) a closing tag (d) a comment
- 39.📋 Which tag goes around each item of a list? (a) <li> (b) <ul> (c) <ol> (d) <p>
-
40.📝 How many paragraphs does this code make?
<p>I love mangoes.</p>
<h2>I love mangoes.</h2>
<h2>Good morning!</h2>
Answer key
- to leave notes
- False
- True
- </h2>
- <ul>
- <html>
- </li>
- stores a website’s files
- height
- <!DOCTYPE html>
- 4
- <ul>
- True
- 3
- False
- <h4>
- <body>
- Easy snacks
- <!--
- an empty tag
- games.html
- 1
- </h1>
- an opening tag
- </title>
- 6
- dog.jpg
- Visit the site
- 8
- a code editor
- starts a new line
- 3
- About us
- <meta charset="utf-8">
- <h5>
- maths.html
- 2
- an attribute
- <li>
- 1
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids