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 of these goes in the head? (a) <table> (b) <style> (c) <p> (d) <h1>
- 2.🔢 In a basic web page file, which comes FIRST? (a) </head> (b) <body> (c) <!DOCTYPE html> (d) </body>
-
3.🔗 Which words do you click on?
<a href="art.html">About us</a> (a) href (b) About us (c) Contact us (d) art.html - 4.🔗 Which attribute holds the address of a link? (a) alt (b) href (c) id (d) src
- 5.True or false: <link rel="stylesheet"> goes in the head. (a) False (b) True
- 6.Which of these has a closing tag? (a) <meta> (b) <img> (c) <b> (d) <input>
- 7.True or false: <li> is one item of a list. (a) False (b) True
- 8.🔗 What does target="_blank" do to a link? (a) makes it bold (b) opens it in a new tab (c) makes it blank (d) hides the link
-
9.📋 How many items does this list show?
<ol>
<li>Grapes</li>
<li>Orange</li>
<li>Litchi</li>
</ol> -
10.💬 How many paragraphs show on the page?
<p>Hello, world!</p>
<p>My pets</p>
<p>Fun facts</p>
<!-- <p>I love mangoes.</p> -->
<!-- <p>Cricket is fun.</p> --> -
11.🔍 Which line is missing its closing tag?
line 1: <strong>Good morning!
line 2: <p>Hello, world!</p>
line 3: <em>The red kite</em> (a) line 2 (b) line 3 (c) line 1 -
12.🔗 Where does this link open?
<a href="about.html">Contact us</a> (a) in a new tab (b) in the same tab -
13.📄 What does the browser tab show for 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) index.html (d) Easy snacks - 14.🔠 Which heading shows the BIGGEST text: <h1>, <h6>, <h2> or <h4>? (a) <h2> (b) <h1> (c) <h6> (d) <h4>
- 15.📝 You type 5 spaces between two words in a <p>. How does the browser show them? (a) as one space (b) as 5 spaces (c) as a dot (d) as a new line
-
16.🔠 How many headings are in this code?
<h1>My best friend</h1>
<h2>Our school trip</h2>
<p>Rain today</p>
<p>Cricket is fun.</p>
<p>Fun facts</p> - 17.🔍 Which is the odd one out? (a) turns HTML into a page (b) stores a website’s files (c) hosts websites online (d) sends pages over the net
-
18.🔗 Where does this link open?
<a href="quiz.html" target="_blank">About us</a> (a) in the same tab (b) in a new tab - 19.📄 Can HTML on its own show paragraphs? (a) Yes (b) No
- 20.Which of these is an opening tag? (a) </h1> (b) </p> (c) <body> (d) </b>
- 21.📝 Does <ul> have a closing tag, or is it an empty tag? (a) has a closing tag (b) an empty tag
-
22.🔍 Which line is missing its closing tag?
line 1: <em>Cricket is fun.</em>
line 2: <strong>My best friend
line 3: <h3>Hello, world!</h3> (a) line 3 (b) line 2 (c) line 1 - 23.📋 Which list suits a shopping list in any order? (a) <br> (b) <ol> (c) <hr> (d) <ul>
- 24.🖼️ Which attribute of <img> describes the picture? (a) height (b) alt (c) src (d) width
-
25.💬 How many paragraphs show on the page?
<!-- <p>Hello, world!</p> -->
<!-- <p>Rain today</p> -->
<!-- <p>Good morning!</p> -->
<!-- <p>Cricket is fun.</p> -->
<p>The red kite</p> - 26.🔠 Which heading shows the SMALLEST text: <h4>, <h3>, <h2> or <h6>? (a) <h2> (b) <h4> (c) <h6> (d) <h3>
- 27.Which of these is a closing tag? (a) </title> (b) <li> (c) <title> (d) <body>
- 28.True or false: in <img>, width tells which image to load. (a) True (b) False
- 29.📄 Where does <meta charset="utf-8"> go: in the head or in the body? (a) in the head (b) in the body
-
30.🔍 Which line is missing its closing tag?
line 1: <h2>My best friend</h2>
line 2: <em>Hello, world!</em>
line 3: <i>Good morning! (a) line 2 (b) line 3 (c) line 1 -
31.💬 How many paragraphs show on the page?
<p>Our school trip</p>
<!-- <p>Cricket is fun.</p> -->
<p>My pets</p>
<p>Good morning!</p> - 32.🖼️ Which attribute of <img> names the picture file? (a) width (b) height (c) alt (d) src
- 33.🔠 Which heading shows the BIGGEST text: <h2>, <h4>, <h1> or <h6>? (a) <h2> (b) <h4> (c) <h6> (d) <h1>
- 34.📄 Which part holds everything you see on the page? (a) the head (b) the body (c) the doctype (d) the title
-
35.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>My Hobbies</title>
</head>
<body>
<h1>Easy snacks</h1>
<p>Try this poha.</p>
</body>
</html> (a) body (b) Easy snacks (c) Try this poha. (d) My Hobbies - 36.🏷️ HTML marks up text using ___. (a) keys (b) wires (c) pixels (d) tags
- 37.🧩 An opening tag + content + a closing tag together make an ___. (a) editor (b) element (c) address (d) attribute
- 38.📝 What does <br> do? (a) makes a list (b) adds a picture (c) makes text bold (d) starts a new line
-
39.🔗 Which address opens when you click this link?
<a href="about.html">Art corner</a> (a) Art corner (b) about.html (c) https://example.com (d) contact.html - 40.True or false: <table> goes in the head. (a) True (b) False
Answer key
- <style>
- <!DOCTYPE html>
- About us
- href
- True
- <b>
- True
- opens it in a new tab
- 3
- 3
- line 1
- in the same tab
- Space Facts
- <h1>
- as one space
- 2
- turns HTML into a page
- in a new tab
- Yes
- <body>
- has a closing tag
- line 2
- <ul>
- alt
- 1
- <h6>
- </title>
- False
- in the head
- line 3
- 3
- src
- <h1>
- the body
- Easy snacks
- tags
- element
- starts a new line
- about.html
- False
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids