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 words do you click on?
<a href="https://example.com">Play games</a> (a) href (b) https://example.com (c) About us (d) Play games -
2.📋 What number does the browser show next to “Litchi”?
<ol>
<li>Orange</li>
<li>Mango</li>
<li>Litchi</li>
</ol> - 3.🏷️ Which is the closing tag for <small>? (a) <small> (b) <\small> (c) </small> (d) <small/>
-
4.🔠 How many headings are in this code?
<h1>My pets</h1>
<p>The red kite</p>
<p>I love mangoes.</p>
<h2>The red kite</h2>
<h4>Cricket is fun.</h4> - 5.💬 Can anyone read your comments by viewing the page source? (a) Yes (b) No
-
6.🔠 How many headings are in this code?
<h1>Good morning!</h1>
<h2>I love mangoes.</h2>
<p>Hello, world!</p>
<p>Good morning!</p> - 7.Which of these is an empty tag? (a) <meta> (b) <b> (c) <ul> (d) <li>
- 8.True or false: <h1> has a closing tag. (a) False (b) True
-
9.💬 How many paragraphs show on the page?
<p>I love mangoes.</p>
<!-- <p>The red kite</p> -->
<p>My pets</p>
<p>Rain today</p>
<p>My best friend</p> - 10.🔗 What does target="_blank" do to a link? (a) makes it blank (b) hides the link (c) makes it bold (d) opens it in a new tab
-
11.📝 On how many lines does the browser show this paragraph?
<p>Rivers flow<br>Kites fly high<br>Stars shine<br>Sky is blue<br>Birds sing</p> -
12.🔠 How many headings are in this code?
<h1>I love mangoes.</h1>
<h2>Fun facts</h2>
<p>Good morning!</p>
<p>Rain today</p> - 13.🔠 Are headings shown in bold by default? (a) Yes (b) No
-
14.🔗 Which words do you click on?
<a href="maths.html">Take the quiz</a> (a) Play games (b) Take the quiz (c) href (d) maths.html -
15.💬 How many paragraphs show on the page?
<p>Good morning!</p>
<!-- <p>Hello, world!</p> -->
<p>My best friend</p>
<!-- <p>The red kite</p> --> - 16.📝 Does <br> have a closing tag, or is it an empty tag? (a) has a closing tag (b) an empty tag
-
17.🔠 How many headings are in this code?
<h1>My pets</h1>
<h3>I love mangoes.</h3>
<h4>Cricket is fun.</h4>
<h4>Cricket is fun.</h4>
<h3>The red kite</h3> - 18.Which of these goes in the head? (a) <img> (b) <a> (c) <ul> (d) <title>
-
19.📝 How many paragraphs does this code make?
<p>Fun facts</p>
<h2>I love mangoes.</h2>
<h2>Hello, world!</h2>
<h2>My best friend</h2> - 20.Which of these is true of a code editor? (a) has an address bar (b) answers page requests (c) opens web pages for us (d) colours code to help us
-
21.🔍 Which line is missing its closing tag?
line 1: <i>Our school trip
line 2: <u>My best friend</u>
line 3: <h3>Fun facts</h3> (a) line 2 (b) line 3 (c) line 1 -
22.🔠 How many headings are in this code?
<h1>The red kite</h1>
<p>I love mangoes.</p>
<p>Our school trip</p>
<p>Good morning!</p> - 23.🔠 Which heading shows the BIGGEST text: <h2>, <h4>, <h5> or <h3>? (a) <h3> (b) <h5> (c) <h4> (d) <h2>
- 24.True or false: a code editor is where we type code. (a) True (b) False
-
25.🔍 Which line is missing its closing tag?
line 1: <p>Our school trip</p>
line 2: <small>Good morning!</small>
line 3: <i>Hello, world! (a) line 1 (b) line 2 (c) line 3 -
26.🔗 Where does this link open?
<a href="contact.html" target="_blank">Visit the site</a> (a) in the same tab (b) in a new tab -
27.🔠 How many headings are in this code?
<h1>My best friend</h1>
<h4>My pets</h4>
<p>Fun facts</p>
<p>The red kite</p> - 28.📋 Which list tag lists steps in order? (a) <ul> (b) <li> (c) <ol>
-
29.📋 How many items does this list show?
<ul>
<li>Grapes</li>
<li>Papaya</li>
<li>Orange</li>
<li>Jamun</li>
<li>Litchi</li>
</ul> - 30.🔠 Which heading shows the SMALLEST text: <h5>, <h2>, <h4> or <h1>? (a) <h4> (b) <h5> (c) <h1> (d) <h2>
- 31.🖼️ Which attribute of <img> names the picture file? (a) src (b) height (c) width (d) alt
- 32.🌐 Which one shows pages from the web? (a) a code editor (b) a web browser (c) a web server
- 33.💬 How does an HTML comment start? (a) <!-- (b) /* (c) // (d) #
- 34.🔍 Which is the odd one out? (a) sends pages over the net (b) hosts websites online (c) stores a website’s files (d) turns HTML into a page
- 35.True or false: in <img>, width shows if the image fails. (a) True (b) False
- 36.🖼️ Why do we add alt text to an image? (a) to load it faster (b) to colour it (c) to describe the image (d) to make it bigger
-
37.🔗 Where does this link open?
<a href="art.html">About us</a> (a) in the same tab (b) in a new tab - 38.🔠 Which heading shows the BIGGEST text: <h1>, <h5>, <h3> or <h2>? (a) <h5> (b) <h3> (c) <h1> (d) <h2>
- 39.📄 Where does <style> go: in the head or in the body? (a) in the body (b) in the head
- 40.🔠 Which heading shows the SMALLEST text: <h5>, <h4>, <h6> or <h1>? (a) <h6> (b) <h4> (c) <h5> (d) <h1>
Answer key
- Play games
- 3
- </small>
- 3
- Yes
- 2
- <meta>
- True
- 4
- opens it in a new tab
- 5
- 2
- Yes
- Take the quiz
- 2
- an empty tag
- 5
- <title>
- 1
- colours code to help us
- line 1
- 1
- <h2>
- True
- line 3
- in a new tab
- 2
- <ol>
- 5
- <h5>
- src
- a web browser
- <!--
- turns HTML into a page
- False
- to describe the image
- in the same tab
- <h1>
- in the head
- <h6>
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids