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.💬 How does an HTML comment start? (a) # (b) // (c) <!-- (d) /*
-
2.🔠 How many headings are in this code?
<h1>My best friend</h1>
<h3>Our school trip</h3>
<p>I love mangoes.</p> - 3.📄 What is the first line of an HTML5 page? (a) <html> (b) <!DOCTYPE html> (c) <body> (d) <head>
-
4.🔍 One closing tag is missing. Which one?
<i>Cricket is fun.
<small>My best friend</small>
<strong>Good morning!</strong> (a) </strong> (b) </h2> (c) </i> (d) </small> - 5.🔠 How many heading levels does HTML have? (a) 6 (b) 10 (c) 3 (d) 4
- 6.🏷️ Is <li> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
- 7.🔠 Which heading shows the BIGGEST text: <h3>, <h1>, <h5> or <h2>? (a) <h3> (b) <h5> (c) <h1> (d) <h2>
- 8.🧩 An opening tag + content + a closing tag together make an ___. (a) address (b) editor (c) element (d) attribute
- 9.True or false: HTML on its own cannot make headings. (a) False (b) True
- 10.📝 You type 5 spaces between two words in a <p>. How does the browser show them? (a) as 5 spaces (b) as one space (c) as a new line (d) as a dot
-
11.🖼️ Which picture file does the browser load?
<img src="tiger.jpg" alt="A tiger asleep" width="400"> (a) A tiger asleep (b) map.png (c) tiger.jpg (d) kite.png - 12.📛 In <a href="x.html">, what is href? (a) a closing tag (b) a comment (c) an element name (d) an attribute
-
13.🔗 Which words do you click on?
<a href="games.html">Contact us</a> (a) href (b) games.html (c) Visit the site (d) Contact us - 14.Which of these is true of a web server? (a) opens web pages for us (b) is where we type code (c) hosts websites online (d) saves our .html files
-
15.🔠 How many headings are in this code?
<h1>Fun facts</h1>
<h2>My pets</h2>
<h4>Fun facts</h4>
<h4>Good morning!</h4> -
16.🔍 One closing tag is missing. Which one?
<h3>The red kite</h3>
<small>My best friend</small>
<p>Rain today (a) </h3> (b) </p> (c) </small> (d) </i> -
17.📋 Does this list show bullets or numbers?
<ul>
<li>Mango</li>
<li>Litchi</li>
<li>Grapes</li>
</ul> (a) numbers (b) bullets - 18.📝 Does <h1> have a closing tag, or is it an empty tag? (a) has a closing tag (b) an empty tag
- 19.True or false: <li> is an ordered list. (a) False (b) True
- 20.📄 Where does <table> go: in the head or in the body? (a) in the body (b) in the head
- 21.Which of these goes in the body? (a) <title> (b) <link rel="stylesheet"> (c) <meta charset="utf-8"> (d) <ul>
-
22.🖼️ How many pixels wide is the picture drawn?
<img src="cake.jpg" alt="Birthday cake" width="300"> - 23.💬 Does the browser show comments on the page? (a) No (b) Yes
-
24.📋 What number does the browser show next to “Guava”?
<ol>
<li>Papaya</li>
<li>Mango</li>
<li>Guava</li>
<li>Litchi</li>
</ol> - 25.📋 Which list suits a shopping list in any order? (a) <br> (b) <ol> (c) <ul> (d) <hr>
- 26.🔢 In a basic web page file, which comes FIRST? (a) <html> (b) <body> (c) <!DOCTYPE html> (d) </head>
- 27.🔗 What does HyperText mean? (a) secret text (b) very big text (c) text in colour (d) text with links
-
28.🔍 Which line is missing its closing tag?
line 1: <h3>I love mangoes.
line 2: <strong>Our school trip</strong>
line 3: <h1>The red kite</h1> (a) line 3 (b) line 2 (c) line 1 - 29.💬 Why do coders write comments? (a) to add colour (b) to show pictures (c) to leave notes (d) to make links
- 30.🏷️ Every HTML tag starts with which sign? (a) < (b) ( (c) [ (d) {
- 31.True or false: a web browser has an address bar. (a) True (b) False
- 32.True or false: HTML on its own can add pictures to a page. (a) True (b) False
- 33.True or false: HTML on its own can count button clicks. (a) False (b) True
- 34.🔠 Which heading shows the BIGGEST text: <h1>, <h3>, <h6> or <h4>? (a) <h6> (b) <h4> (c) <h1> (d) <h3>
- 35.💬 Can anyone read your comments by viewing the page source? (a) No (b) Yes
- 36.🖼️ Which attribute of <img> names the picture file? (a) src (b) alt (c) height (d) width
- 37.🌐 Which one opens web pages for us? (a) a code editor (b) a web server (c) a web browser
-
38.🔠 How many headings are in this code?
<h1>Our school trip</h1>
<h3>Good morning!</h3>
<p>I love mangoes.</p> -
39.📝 On how many lines does the browser show this paragraph?
<p>Kites fly high<br>Stars shine<br>Roses are red</p> - 40.🔠 Which heading shows the BIGGEST text: <h4>, <h5>, <h2> or <h3>? (a) <h3> (b) <h5> (c) <h4> (d) <h2>
Answer key
- <!--
- 2
- <!DOCTYPE html>
- </i>
- 6
- an opening tag
- <h1>
- element
- False
- as one space
- tiger.jpg
- an attribute
- Contact us
- hosts websites online
- 4
- </p>
- bullets
- has a closing tag
- False
- in the body
- <ul>
- 300
- No
- 3
- <ul>
- <!DOCTYPE html>
- text with links
- line 1
- to leave notes
- <
- True
- True
- False
- <h1>
- Yes
- src
- a web browser
- 2
- 3
- <h2>
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids