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.True or false: <table> goes in the body. (a) True (b) False
- 2.🏷️ Is <p> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
-
3.🔠 How many headings are in this code?
<h1>My best friend</h1>
<h4>I love mangoes.</h4>
<p>My pets</p>
<p>My pets</p>
<h4>Hello, world!</h4> -
4.💬 Which text will NOT show on the page?
<p>Rain today</p>
<p>Fun facts</p>
<!-- <p>Our school trip</p> --> (a) Rain today (b) Our school trip (c) Fun facts - 5.True or false: <title> goes in the body. (a) False (b) True
-
6.📝 On how many lines does the browser show this paragraph?
<p>Rivers flow<br>Sky is blue<br>Kites fly high<br>Birds sing</p> - 7.🖼️ Does <img> need a closing tag? (a) No (b) Yes
-
8.📝 On how many lines does the browser show this paragraph?
<p>Stars shine<br>Sky is blue<br>Kites fly high<br>Birds sing<br>Roses are red</p> - 9.📄 Can HTML on its own run a game loop? (a) Yes (b) No
- 10.🔍 Which is the odd one out? (a) stores a website’s files (b) saves our .html files (c) shows line numbers (d) is where we type code
-
11.📝 On how many lines does the browser show this paragraph?
<p>Rivers flow<br>Kites fly high<br>Birds sing<br>Stars shine</p> - 12.🌐 Which one has an address bar? (a) a code editor (b) a web browser (c) a web server
- 13.📄 What is the first line of an HTML5 page? (a) <!DOCTYPE html> (b) <body> (c) <head> (d) <html>
- 14.True or false: HTML on its own can add up two numbers. (a) False (b) True
-
15.🔗 Where does this link open?
<a href="https://example.com" target="_blank">Play games</a> (a) in a new tab (b) in the same tab -
16.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="map.png" alt="Map of India" width="100"> (a) Birthday cake (b) map.png (c) Map of India (d) width - 17.🔠 How many <h1> headings should a page usually have? (a) 6 (b) 10 (c) 3 (d) 1
- 18.🏷️ Is <h1> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
- 19.🖼️ Which attribute of <img> shows if the image fails? (a) src (b) width (c) alt (d) height
- 20.📋 Which list shows the steps of a recipe best? (a) <hr> (b) <ul> (c) <ol> (d) <br>
- 21.📝 Does <title> have a closing tag, or is it an empty tag? (a) has a closing tag (b) an empty tag
- 22.Which of these is true of a web server? (a) answers page requests (b) turns HTML into a page (c) shows line numbers (d) shows pages from the web
- 23.💬 Why do coders write comments? (a) to add colour (b) to show pictures (c) to make links (d) to leave notes
- 24.🔠 Which heading shows the BIGGEST text: <h3>, <h2>, <h1> or <h4>? (a) <h2> (b) <h3> (c) <h4> (d) <h1>
-
25.💬 Which text will NOT show on the page?
<p>Rain today</p>
<p>Hello, world!</p>
<!-- <p>Fun facts</p> -->
<p>Good morning!</p> (a) Hello, world! (b) Rain today (c) Fun facts (d) Good morning! - 26.True or false: HTML on its own cannot make links to pages. (a) True (b) False
-
27.🔗 Which address opens when you click this link?
<a href="contact.html">Visit the site</a> (a) maths.html (b) contact.html (c) Visit the site (d) https://example.com - 28.True or false: a web server shows line numbers. (a) False (b) True
-
29.💬 Which text will NOT show on the page?
<p>Good morning!</p>
<p>Fun facts</p>
<!-- <p>My best friend</p> --> (a) Fun facts (b) Good morning! (c) My best friend - 30.Which of these goes in the body? (a) <title> (b) <link rel="stylesheet"> (c) <style> (d) <ul>
-
31.📋 How many items does this list show?
<ul>
<li>Grapes</li>
<li>Banana</li>
<li>Orange</li>
<li>Jamun</li>
<li>Mango</li>
</ul> - 32.🔠 Which heading shows the BIGGEST text: <h4>, <h5>, <h3> or <h1>? (a) <h4> (b) <h1> (c) <h3> (d) <h5>
-
33.📝 How many paragraphs does this code make?
<p>Good morning!</p>
<p>The red kite</p>
<p>The red kite</p>
<p>Hello, world!</p>
<p>Hello, world!</p>
<p>Cricket is fun.</p> - 34.🔠 Which tag is used for the main title on a page? (a) <p> (b) <h6> (c) <h1> (d) <br>
- 35.True or false: <title> has a closing tag. (a) False (b) True
-
36.💬 Which text will NOT show on the page?
<p>My best friend</p>
<!-- <p>My pets</p> -->
<p>Fun facts</p>
<p>The red kite</p> (a) My pets (b) Fun facts (c) The red kite (d) My best friend -
37.🔠 How many headings are in this code?
<h1>My pets</h1>
<h4>Fun facts</h4>
<p>I love mangoes.</p>
<p>My best friend</p>
<p>My best friend</p> - 38.🔡 Are HTML tag names usually written in small letters? (a) Yes (b) No
-
39.🔗 Where does this link open?
<a href="quiz.html" target="_blank">Art corner</a> (a) in a new tab (b) in the same tab - 40.🔠 Which heading shows the BIGGEST text: <h3>, <h5>, <h2> or <h1>? (a) <h3> (b) <h2> (c) <h1> (d) <h5>
Answer key
- True
- an opening tag
- 3
- Our school trip
- False
- 4
- No
- 5
- No
- stores a website’s files
- 4
- a web browser
- <!DOCTYPE html>
- False
- in a new tab
- Map of India
- 1
- an opening tag
- alt
- <ol>
- has a closing tag
- answers page requests
- to leave notes
- <h1>
- Fun facts
- False
- contact.html
- False
- My best friend
- <ul>
- 5
- <h1>
- 6
- <h1>
- True
- My pets
- 2
- Yes
- in a new tab
- <h1>
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids