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.🔢 In a basic web page file, which comes first: “<body>” or “</head>”? (a) <body> (b) </head>
- 2.📛 In <a href="x.html">, what is href? (a) an attribute (b) an element name (c) a comment (d) a closing tag
- 3.🔠 Which heading shows the SMALLEST text: <h4>, <h3>, <h1> or <h5>? (a) <h1> (b) <h3> (c) <h4> (d) <h5>
- 4.🏷️ Which is the closing tag for <h2>? (a) <\h2> (b) <h2/> (c) <h2> (d) </h2>
- 5.🔠 Which heading shows the BIGGEST text: <h2>, <h6>, <h4> or <h3>? (a) <h2> (b) <h4> (c) <h3> (d) <h6>
- 6.🔤 In “HTML”, what does the M stand for? (a) Machine (b) Markup (c) Mouse (d) Modern
- 7.True or false: in <img>, alt is read by screen readers. (a) True (b) False
-
8.🔠 How many headings are in this code?
<h1>The red kite</h1>
<p>I love mangoes.</p>
<p>Our school trip</p> -
9.💬 How many paragraphs show on the page?
<!-- <p>Hello, world!</p> -->
<p>My pets</p>
<!-- <p>Rain today</p> -->
<!-- <p>Fun facts</p> --> -
10.🔗 Which words do you click on?
<a href="https://example.com">Visit the site</a> (a) href (b) Maths fun (c) https://example.com (d) Visit the site - 11.🏷️ What does a closing tag have that an opening tag does not? (a) a hash # (b) a slash / (c) a dot . (d) a dollar $
-
12.🔠 How many headings are in this code?
<h1>Our school trip</h1>
<p>Hello, world!</p>
<h2>The red kite</h2> - 13.🏷️ Is </b> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
- 14.🏷️ Is </h1> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
- 15.🖼️ Which attribute of <img> describes the picture? (a) width (b) height (c) src (d) alt
- 16.Which of these is true of a web server? (a) turns HTML into a page (b) has an address bar (c) shows pages from the web (d) hosts websites online
- 17.Which of these is a closing tag? (a) <p> (b) <li> (c) <h1> (d) </h1>
- 18.🔤 In “HTML”, what do the letters HT stand for? (a) Hot Tags (b) High Tech (c) Home Text (d) HyperText
-
19.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="fort.jpg" alt="An old fort" width="50"> (a) fort.jpg (b) width (c) An old fort (d) A tiger asleep -
20.🖼️ How many pixels wide is the picture drawn?
<img src="moon.png" alt="The full moon" width="200"> - 21.🔠 Which heading shows the SMALLEST text: <h6>, <h4>, <h5> or <h1>? (a) <h4> (b) <h6> (c) <h5> (d) <h1>
- 22.📋 Which list suits a shopping list in any order? (a) <br> (b) <ul> (c) <hr> (d) <ol>
- 23.🔠 Which heading shows the SMALLEST text: <h4>, <h5>, <h1> or <h6>? (a) <h6> (b) <h1> (c) <h4> (d) <h5>
-
24.📋 Does this list show bullets or numbers?
<ol>
<li>Banana</li>
<li>Litchi</li>
<li>Papaya</li>
</ol> (a) bullets (b) numbers - 25.📋 Which tag goes around each item of a list? (a) <ol> (b) <ul> (c) <p> (d) <li>
- 26.🖼️ Which attribute of <img> is read by screen readers? (a) src (b) width (c) alt (d) height
-
27.🔗 Which address opens when you click this link?
<a href="maths.html">Play games</a> (a) art.html (b) news.html (c) Play games (d) maths.html -
28.📝 On how many lines does the browser show this paragraph?
<p>Birds sing<br>Rivers flow<br>Sky is blue<br>Roses are red<br>Kites fly high</p> - 29.🔍 Which is the odd one out? (a) saves our .html files (b) sends pages over the net (c) colours code to help us (d) is where we type code
- 30.🔗 Which attribute holds the address of a link? (a) src (b) href (c) id (d) alt
-
31.🔗 Which words do you click on?
<a href="contact.html">Take the quiz</a> (a) contact.html (b) href (c) Play games (d) Take the quiz - 32.💬 Why do coders write comments? (a) to show pictures (b) to make links (c) to leave notes (d) to add colour
- 33.📄 Where does the text of <title> appear? (a) on the browser tab (b) at the bottom (c) in a big heading (d) nowhere
- 34.🔍 Which is the odd one out? (a) shows pages from the web (b) shows line numbers (c) turns HTML into a page (d) has an address bar
- 35.🔗 What does target="_blank" do to a link? (a) hides the link (b) makes it bold (c) makes it blank (d) opens it in a new tab
- 36.🔍 Which is the odd one out? (a) opens web pages for us (b) is where we type code (c) saves our .html files (d) colours code to help us
- 37.💬 How does an HTML comment start? (a) # (b) // (c) <!-- (d) /*
- 38.📋 Which list shows the steps of a recipe best? (a) <ul> (b) <hr> (c) <br> (d) <ol>
- 39.True or false: <p> goes in the body. (a) True (b) False
- 40.📄 Which part holds everything you see on the page? (a) the body (b) the head (c) the doctype (d) the title
Answer key
- </head>
- an attribute
- <h5>
- </h2>
- <h2>
- Markup
- True
- 1
- 1
- Visit the site
- a slash /
- 2
- a closing tag
- a closing tag
- alt
- hosts websites online
- </h1>
- HyperText
- An old fort
- 200
- <h6>
- <ul>
- <h6>
- numbers
- <li>
- alt
- maths.html
- 5
- sends pages over the net
- href
- Take the quiz
- to leave notes
- on the browser tab
- shows line numbers
- opens it in a new tab
- opens web pages for us
- <!--
- <ol>
- True
- the body
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids