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 heading shows the SMALLEST text: <h2>, <h3>, <h4> or <h5>? (a) <h5> (b) <h2> (c) <h3> (d) <h4>
- 2.🏷️ Is </li> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
- 3.True or false: in <img>, width names the picture file. (a) False (b) True
-
4.🖼️ Which picture file does the browser load?
<img src="kite.png" alt="A red kite" width="200"> (a) cake.jpg (b) map.png (c) kite.png (d) A red kite -
5.🖼️ Which picture file does the browser load?
<img src="bus.jpg" alt="Our school bus" width="200"> (a) bus.jpg (b) fort.jpg (c) tiger.jpg (d) Our school bus - 6.🌐 Which one answers page requests? (a) a code editor (b) a web browser (c) a web server
- 7.Which of these is an empty tag? (a) <b> (b) <p> (c) <li> (d) <meta>
- 8.🏷️ Which is the closing tag for <i>? (a) <i> (b) </i> (c) <i/> (d) <\i>
- 9.True or false: in <img>, src shows if the image fails. (a) True (b) False
- 10.True or false: in <img>, width sets how wide it is. (a) False (b) True
- 11.📝 What does <br> do? (a) makes text bold (b) adds a picture (c) makes a list (d) starts a new line
-
12.📝 How many paragraphs does this code make?
<p>My best friend</p>
<h2>Cricket is fun.</h2>
<p>Hello, world!</p>
<p>Rain today</p> - 13.📄 Which part holds everything you see on the page? (a) the title (b) the body (c) the doctype (d) the head
- 14.🧩 An opening tag + content + a closing tag together make an ___. (a) attribute (b) address (c) editor (d) element
- 15.🔠 How many heading levels does HTML have? (a) 4 (b) 3 (c) 10 (d) 6
- 16.🔗 Which code links to about.html? (a) <a src="about.html"> (b) <a alt="about.html"> (c) <link about.html> (d) <a href="about.html">
- 17.📄 Where does <style> go: in the head or in the body? (a) in the head (b) in the body
-
18.💬 Which text will NOT show on the page?
<p>My pets</p>
<p>Good morning!</p>
<p>Our school trip</p>
<!-- <p>The red kite</p> --> (a) Our school trip (b) The red kite (c) My pets (d) Good morning! - 19.💬 Why do coders write comments? (a) to show pictures (b) to leave notes (c) to add colour (d) to make links
-
20.🔍 Which line is missing its closing tag?
line 1: <p>My pets
line 2: <b>Fun facts</b>
line 3: <h2>The red kite</h2> (a) line 3 (b) line 1 (c) line 2 - 21.🔠 Which tag is used for the main title on a page? (a) <br> (b) <h6> (c) <h1> (d) <p>
-
22.🖼️ How many pixels wide is the picture drawn?
<img src="dog.jpg" alt="A happy dog" width="100"> -
23.🔠 How many headings are in this code?
<h1>Hello, world!</h1>
<h2>Cricket is fun.</h2>
<p>Fun facts</p> - 24.Which of these goes in the head? (a) <link rel="stylesheet"> (b) <h1> (c) <ul> (d) <a>
- 25.📝 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 new line (d) as a dot
- 26.📄 Where does <h1> go: in the head or in the body? (a) in the body (b) in the head
- 27.🔍 Which is the odd one out? (a) colours code to help us (b) is where we type code (c) opens web pages for us (d) saves our .html files
- 28.True or false: in <img>, src tells which image to load. (a) False (b) True
-
29.📝 How many paragraphs does this code make?
<p>The red kite</p>
<p>Rain today</p>
<h2>The red kite</h2>
<h2>Good morning!</h2>
<p>I love mangoes.</p>
<h2>Fun facts</h2> -
30.🔗 Which address opens when you click this link?
<a href="games.html">Art corner</a> (a) about.html (b) Art corner (c) contact.html (d) games.html -
31.🖼️ How many pixels wide is the picture drawn?
<img src="tiger.jpg" alt="A tiger asleep" width="50"> - 32.📋 Which list tag is an ordered list? (a) <ol> (b) <li> (c) <ul>
- 33.📝 Does <li> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
- 34.Which of these is a closing tag? (a) </b> (b) <li> (c) <p> (d) <title>
-
35.📋 How many items does this list show?
<ul>
<li>Grapes</li>
<li>Litchi</li>
<li>Banana</li>
<li>Guava</li>
<li>Jamun</li>
<li>Mango</li>
</ul> - 36.🔗 Which attribute holds the address of a link? (a) id (b) src (c) alt (d) href
-
37.💬 Which text will NOT show on the page?
<p>Rain today</p>
<p>Hello, world!</p>
<!-- <p>I love mangoes.</p> --> (a) Hello, world! (b) I love mangoes. (c) Rain today -
38.💬 How many paragraphs show on the page?
<!-- <p>Hello, world!</p> -->
<p>Cricket is fun.</p>
<p>Our school trip</p>
<!-- <p>My pets</p> -->
<p>I love mangoes.</p> -
39.🔍 One closing tag is missing. Which one?
<strong>I love mangoes.
<em>Our school trip</em>
<i>My pets</i> (a) </em> (b) </i> (c) </strong> (d) </b> -
40.💬 Which text will NOT show on the page?
<!-- <p>My pets</p> -->
<p>Hello, world!</p>
<p>I love mangoes.</p> (a) Hello, world! (b) My pets (c) I love mangoes.
Answer key
- <h5>
- a closing tag
- False
- kite.png
- bus.jpg
- a web server
- <meta>
- </i>
- False
- True
- starts a new line
- 3
- the body
- element
- 6
- <a href="about.html">
- in the head
- The red kite
- to leave notes
- line 1
- <h1>
- 100
- 2
- <link rel="stylesheet">
- as one space
- in the body
- opens web pages for us
- True
- 3
- games.html
- 50
- <ol>
- has a closing tag
- </b>
- 6
- href
- I love mangoes.
- 3
- </strong>
- My pets
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids