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 body? (a) <style> (b) <title> (c) <meta charset="utf-8"> (d) <a>
- 2.📝 Does <p> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
- 3.📄 Where does <p> go: in the head or in the body? (a) in the body (b) in the head
-
4.🔠 How many headings are in this code?
<h1>Hello, world!</h1>
<p>Fun facts</p>
<h2>I love mangoes.</h2>
<h2>Fun facts</h2>
<p>My best friend</p> - 5.📄 What is the first line of an HTML5 page? (a) <!DOCTYPE html> (b) <body> (c) <html> (d) <head>
- 6.🔠 Which heading shows the BIGGEST text: <h1>, <h6>, <h2> or <h5>? (a) <h2> (b) <h6> (c) <h5> (d) <h1>
- 7.🖼️ Which attribute of <img> sets how tall it is? (a) src (b) height (c) alt (d) width
-
8.📋 What number does the browser show next to “Jamun”?
<ol start="5">
<li>Litchi</li>
<li>Jamun</li>
<li>Guava</li>
</ol> - 9.Which of these goes in the body? (a) <meta charset="utf-8"> (b) <style> (c) <table> (d) <title>
- 10.True or false: <ul> is one item of a list. (a) True (b) False
-
11.💬 How many paragraphs show on the page?
<p>Our school trip</p>
<!-- <p>Cricket is fun.</p> -->
<!-- <p>Good morning!</p> -->
<!-- <p>My pets</p> -->
<!-- <p>The red kite</p> --> -
12.🔗 Which address opens when you click this link?
<a href="https://example.com">Play games</a> (a) maths.html (b) Play games (c) https://example.com (d) art.html -
13.📋 Does this list show bullets or numbers?
<ol>
<li>Papaya</li>
<li>Litchi</li>
</ol> (a) bullets (b) numbers -
14.💬 How many paragraphs show on the page?
<!-- <p>Cricket is fun.</p> -->
<p>Fun facts</p>
<!-- <p>Good morning!</p> --> - 15.🔠 Are headings shown in bold by default? (a) No (b) Yes
- 16.📋 Which list tag is an unordered list? (a) <li> (b) <ol> (c) <ul>
- 17.🔠 Which heading shows the BIGGEST text: <h6>, <h2>, <h1> or <h3>? (a) <h6> (b) <h2> (c) <h1> (d) <h3>
- 18.💬 Why do coders write comments? (a) to make links (b) to add colour (c) to leave notes (d) to show pictures
- 19.🏷️ Is <title> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
-
20.📋 What number does the browser show next to “Litchi”?
<ol start="9">
<li>Grapes</li>
<li>Jamun</li>
<li>Litchi</li>
<li>Papaya</li>
</ol> - 21.📝 Does <title> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
- 22.📄 Can HTML on its own count button clicks? (a) Yes (b) No
- 23.🔠 Which heading shows the SMALLEST text: <h3>, <h2>, <h1> or <h6>? (a) <h3> (b) <h2> (c) <h6> (d) <h1>
- 24.🖼️ Does <img> need a closing tag? (a) Yes (b) No
- 25.🏷️ Which is the closing tag for <u>? (a) </u> (b) <u> (c) <\u> (d) <u/>
-
26.💬 Which text will NOT show on the page?
<p>My pets</p>
<p>Cricket is fun.</p>
<!-- <p>Our school trip</p> -->
<p>I love mangoes.</p> (a) My pets (b) Cricket is fun. (c) Our school trip (d) I love mangoes. - 27.🧩 An opening tag + content + a closing tag together make an ___. (a) editor (b) element (c) attribute (d) address
-
28.🔍 One closing tag is missing. Which one?
<strong>The red kite</strong>
<small>I love mangoes.
<h1>Cricket is fun.</h1> (a) </h1> (b) </small> (c) </h3> (d) </strong> -
29.📝 On how many lines does the browser show this paragraph?
<p>Sky is blue<br>Birds sing<br>Kites fly high<br>Roses are red</p> - 30.🖼️ Which attribute of <img> shows if the image fails? (a) height (b) width (c) src (d) alt
- 31.Which of these is true of a web server? (a) shows line numbers (b) has an address bar (c) is where we type code (d) stores a website’s files
- 32.Which of these is a closing tag? (a) </body> (b) <h1> (c) <b> (d) <title>
-
33.💬 How many paragraphs show on the page?
<!-- <p>Rain today</p> -->
<p>Good morning!</p>
<!-- <p>Our school trip</p> -->
<p>I love mangoes.</p>
<!-- <p>The red kite</p> --> - 34.🔠 How many heading levels does HTML have? (a) 3 (b) 4 (c) 6 (d) 10
-
35.💬 Which text will NOT show on the page?
<!-- <p>Our school trip</p> -->
<p>The red kite</p>
<p>Fun facts</p> (a) Fun facts (b) Our school trip (c) The red kite - 36.📄 Can HTML on its own pick a random number? (a) No (b) Yes
- 37.🔠 Which heading shows the SMALLEST text: <h5>, <h6>, <h3> or <h1>? (a) <h3> (b) <h1> (c) <h6> (d) <h5>
- 38.True or false: a code editor saves our .html files. (a) True (b) False
- 39.True or false: in <img>, width names the picture file. (a) False (b) True
-
40.💬 Which text will NOT show on the page?
<p>Our school trip</p>
<p>The red kite</p>
<p>My best friend</p>
<!-- <p>Cricket is fun.</p> --> (a) Our school trip (b) My best friend (c) The red kite (d) Cricket is fun.
Answer key
- <a>
- has a closing tag
- in the body
- 3
- <!DOCTYPE html>
- <h1>
- height
- 6
- <table>
- False
- 1
- https://example.com
- numbers
- 1
- Yes
- <ul>
- <h1>
- to leave notes
- an opening tag
- 11
- has a closing tag
- No
- <h6>
- No
- </u>
- Our school trip
- element
- </small>
- 4
- alt
- stores a website’s files
- </body>
- 2
- 6
- Our school trip
- No
- <h6>
- True
- False
- Cricket is fun.
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids