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 line is missing its closing tag?
line 1: <h2>The red kite
line 2: <p>Our school trip</p>
line 3: <h1>I love mangoes.</h1> (a) line 2 (b) line 1 (c) line 3 - 2.🔢 In a basic web page file, which comes LAST? (a) <head> (b) <!DOCTYPE html> (c) </body> (d) </html>
- 3.🔠 Which tag is used for the main title on a page? (a) <h6> (b) <p> (c) <br> (d) <h1>
- 4.📄 Where does <a> go: in the head or in the body? (a) in the head (b) in the body
- 5.Which of these is an opening tag? (a) </body> (b) <p> (c) </p> (d) </h1>
-
6.📋 How many items does this list show?
<ul>
<li>Orange</li>
<li>Guava</li>
</ul> -
7.📝 How many paragraphs does this code make?
<p>Fun facts</p>
<h2>The red kite</h2>
<h2>My pets</h2>
<p>Hello, world!</p>
<h2>Rain today</h2> - 8.True or false: a code editor is where we type code. (a) True (b) False
- 9.🏷️ Is </b> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
- 10.🏷️ Is <body> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
- 11.Which of these is a closing tag? (a) <body> (b) <p> (c) </p> (d) <li>
- 12.💬 How does an HTML comment end? (a) --> (b) >> (c) // (d) */
- 13.True or false: in <img>, width sets how wide it is. (a) False (b) True
-
14.🖼️ How many pixels wide is the picture drawn?
<img src="moon.png" alt="The full moon" width="150"> -
15.💬 Which text will NOT show on the page?
<!-- <p>Hello, world!</p> -->
<p>Cricket is fun.</p>
<p>The red kite</p>
<p>Good morning!</p> (a) Cricket is fun. (b) Good morning! (c) The red kite (d) Hello, world! -
16.🔍 Which line is missing its closing tag?
line 1: <u>I love mangoes.</u>
line 2: <h3>Hello, world!</h3>
line 3: <p>The red kite (a) line 3 (b) line 2 (c) line 1 - 17.🖼️ Which tag puts a picture on a page? (a) <p> (b) <img> (c) <pic> (d) <a>
- 18.🏷️ Which is the closing tag for <em>? (a) <em/> (b) </em> (c) <\em> (d) <em>
-
19.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="fort.jpg" alt="An old fort" width="100"> (a) width (b) fort.jpg (c) An old fort (d) A tiger asleep -
20.🔗 Where does this link open?
<a href="contact.html" target="_blank">Visit the site</a> (a) in a new tab (b) in the same tab - 21.🔢 In a basic web page file, which comes FIRST? (a) <!DOCTYPE html> (b) <body> (c) </html> (d) <head>
-
22.🔗 Which address opens when you click this link?
<a href="https://example.com">Contact us</a> (a) Contact us (b) https://example.com (c) maths.html (d) art.html -
23.💬 Which text will NOT show on the page?
<!-- <p>My best friend</p> -->
<p>Rain today</p>
<p>Fun facts</p>
<p>Good morning!</p> (a) Fun facts (b) Rain today (c) Good morning! (d) My best friend - 24.True or false: HTML on its own cannot run a game loop. (a) False (b) True
- 25.True or false: HTML on its own can make tables. (a) False (b) True
- 26.🔠 Which heading shows the BIGGEST text: <h3>, <h1>, <h6> or <h2>? (a) <h3> (b) <h1> (c) <h2> (d) <h6>
-
27.🔍 One closing tag is missing. Which one?
<u>My pets
<h3>Good morning!</h3>
<em>Our school trip</em> (a) </h3> (b) </small> (c) </em> (d) </u> -
28.💬 Which text will NOT show on the page?
<p>Good morning!</p>
<p>My best friend</p>
<!-- <p>Rain today</p> -->
<p>My pets</p> (a) My best friend (b) Good morning! (c) Rain today (d) My pets - 29.🧩 An opening tag + content + a closing tag together make an ___. (a) attribute (b) address (c) editor (d) element
- 30.🔠 Which heading shows the SMALLEST text: <h4>, <h1>, <h2> or <h3>? (a) <h2> (b) <h4> (c) <h3> (d) <h1>
- 31.📛 In <a href="x.html">, what is href? (a) an attribute (b) a closing tag (c) a comment (d) an element name
- 32.Which of these is true of a code editor? (a) has an address bar (b) saves our .html files (c) opens web pages for us (d) answers page requests
-
33.📝 On how many lines does the browser show this paragraph?
<p>Roses are red<br>Stars shine<br>Rivers flow<br>Kites fly high<br>Birds sing</p> - 34.📄 What is the first line of an HTML5 page? (a) <html> (b) <body> (c) <head> (d) <!DOCTYPE html>
-
35.🔗 Where does this link open?
<a href="https://example.com" target="_blank">Maths fun</a> (a) in a new tab (b) in the same tab - 36.🔗 Which attribute holds the address of a link? (a) src (b) id (c) alt (d) href
-
37.💬 Which text will NOT show on the page?
<!-- <p>Our school trip</p> -->
<p>My pets</p>
<p>Cricket is fun.</p>
<p>I love mangoes.</p> (a) My pets (b) Cricket is fun. (c) Our school trip (d) I love mangoes. - 38.🔠 Which heading shows the BIGGEST text: <h2>, <h1>, <h3> or <h5>? (a) <h5> (b) <h1> (c) <h2> (d) <h3>
-
39.🔠 How many headings are in this code?
<h1>Our school trip</h1>
<h3>The red kite</h3>
<p>My pets</p>
<p>I love mangoes.</p> -
40.💬 How many paragraphs show on the page?
<!-- <p>Hello, world!</p> -->
<!-- <p>Good morning!</p> -->
<!-- <p>Rain today</p> -->
<p>Cricket is fun.</p>
<p>The red kite</p>
Answer key
- line 1
- </html>
- <h1>
- in the body
- <p>
- 2
- 2
- True
- a closing tag
- an opening tag
- </p>
- -->
- True
- 150
- Hello, world!
- line 3
- <img>
- </em>
- An old fort
- in a new tab
- <!DOCTYPE html>
- https://example.com
- My best friend
- True
- True
- <h1>
- </u>
- Rain today
- element
- <h4>
- an attribute
- saves our .html files
- 5
- <!DOCTYPE html>
- in a new tab
- href
- Our school trip
- <h1>
- 2
- 2
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids