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">About us</a> (a) href (b) About us (c) https://example.com (d) Contact us - 2.Which of these goes in the body? (a) <meta charset="utf-8"> (b) <link rel="stylesheet"> (c) <img> (d) <style>
-
3.🔗 Where does this link open?
<a href="news.html" target="_blank">Art corner</a> (a) in the same tab (b) in a new tab - 4.Which of these is a closing tag? (a) <p> (b) <h1> (c) </p> (d) <body>
- 5.🔠 How many <h1> headings should a page usually have? (a) 10 (b) 6 (c) 3 (d) 1
-
6.🔍 Which line is missing its closing tag?
line 1: <strong>Fun facts
line 2: <h1>Hello, world!</h1>
line 3: <h3>I love mangoes.</h3> (a) line 3 (b) line 1 (c) line 2 -
7.🔗 Which words do you click on?
<a href="maths.html">Visit the site</a> (a) Maths fun (b) maths.html (c) Visit the site (d) href - 8.🔢 In a basic web page file, which comes LAST? (a) <!DOCTYPE html> (b) </html> (c) </head> (d) <body>
- 9.True or false: <li> lists things in any order. (a) True (b) False
-
10.🔠 How many headings are in this code?
<h1>My pets</h1>
<p>Fun facts</p>
<p>My pets</p>
<h3>I love mangoes.</h3>
<p>Hello, world!</p> -
11.🔗 Which address opens when you click this link?
<a href="news.html">School news</a> (a) games.html (b) quiz.html (c) news.html (d) School news -
12.💬 How many paragraphs show on the page?
<!-- <p>Cricket is fun.</p> -->
<!-- <p>Good morning!</p> -->
<p>Hello, world!</p>
<!-- <p>Our school trip</p> --> - 13.📝 What does <hr> draw? (a) a table (b) a link (c) a line across the page (d) a picture
- 14.📄 Where does the text of <title> appear? (a) in a big heading (b) on the browser tab (c) at the bottom (d) nowhere
-
15.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="tiger.jpg" alt="A tiger asleep" width="400"> (a) width (b) A tiger asleep (c) A red kite (d) tiger.jpg - 16.True or false: a code editor opens web pages for us. (a) True (b) False
- 17.True or false: <ul> lists things in any order. (a) False (b) True
-
18.💬 How many paragraphs show on the page?
<!-- <p>The red kite</p> -->
<p>Cricket is fun.</p>
<p>My best friend</p>
<!-- <p>Our school trip</p> -->
<p>I love mangoes.</p> - 19.💬 How does an HTML comment start? (a) <!-- (b) # (c) // (d) /*
- 20.🖼️ 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
-
21.🔍 One closing tag is missing. Which one?
<b>Cricket is fun.
<h3>Hello, world!</h3>
<strong>My pets</strong> (a) </h3> (b) </strong> (c) </b> (d) </i> - 22.🔗 Which attribute holds the address of a link? (a) id (b) src (c) href (d) alt
-
23.🔗 Which address opens when you click this link?
<a href="games.html">Maths fun</a> (a) contact.html (b) about.html (c) Maths fun (d) games.html -
24.🔗 Where does this link open?
<a href="games.html" target="_blank">Art corner</a> (a) in a new tab (b) in the same tab - 25.🏷️ Which is the closing tag for <small>? (a) </small> (b) <small> (c) <\small> (d) <small/>
-
26.📋 How many items does this list show?
<ul>
<li>Litchi</li>
<li>Guava</li>
<li>Mango</li>
<li>Papaya</li>
</ul> - 27.True or false: <input> has a closing tag. (a) True (b) False
-
28.📋 What number does the browser show next to “Litchi”?
<ol start="4">
<li>Banana</li>
<li>Mango</li>
<li>Litchi</li>
</ol> - 29.🔢 In a basic web page file, which comes first: “<!DOCTYPE html>” or “</body>”? (a) <!DOCTYPE html> (b) </body>
- 30.Which of these is an empty tag? (a) <title> (b) <p> (c) <li> (d) <hr>
-
31.💬 Which text will NOT show on the page?
<p>Good morning!</p>
<p>Our school trip</p>
<p>The red kite</p>
<!-- <p>My pets</p> --> (a) My pets (b) Our school trip (c) The red kite (d) Good morning! - 32.🏷️ Is <p> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
- 33.🖼️ Which attribute of <img> describes the picture? (a) width (b) alt (c) src (d) height
- 34.📄 Where does <a> go: in the head or in the body? (a) in the head (b) in the body
- 35.🌐 Which one sends pages over the net? (a) a web browser (b) a web server (c) a code editor
-
36.💬 Which text will NOT show on the page?
<!-- <p>Hello, world!</p> -->
<p>Fun facts</p>
<p>The red kite</p> (a) The red kite (b) Hello, world! (c) Fun facts - 37.True or false: in <img>, alt shows if the image fails. (a) False (b) True
-
38.🖼️ How many pixels wide is the picture drawn?
<img src="fort.jpg" alt="An old fort" width="400"> - 39.🔗 Which tag makes a clickable link? (a) <link> (b) <img> (c) <p> (d) <a>
- 40.🔠 Which heading shows the BIGGEST text: <h3>, <h2>, <h6> or <h1>? (a) <h3> (b) <h1> (c) <h2> (d) <h6>
Answer key
- About us
- <img>
- in a new tab
- </p>
- 1
- line 1
- Visit the site
- </html>
- False
- 2
- news.html
- 1
- a line across the page
- on the browser tab
- A tiger asleep
- False
- True
- 3
- <!--
- to describe the image
- </b>
- href
- games.html
- in a new tab
- </small>
- 4
- False
- 6
- <!DOCTYPE html>
- <hr>
- My pets
- an opening tag
- alt
- in the body
- a web server
- Hello, world!
- True
- 400
- <a>
- <h1>
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids