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: <u>Hello, world!</u>
line 2: <b>Fun facts</b>
line 3: <p>Rain today (a) line 2 (b) line 1 (c) line 3 - 2.🔠 Which heading shows the BIGGEST text: <h4>, <h1>, <h5> or <h2>? (a) <h4> (b) <h1> (c) <h5> (d) <h2>
-
3.💬 How many paragraphs show on the page?
<!-- <p>Our school trip</p> -->
<!-- <p>My pets</p> -->
<!-- <p>I love mangoes.</p> -->
<p>Rain today</p>
<!-- <p>Good morning!</p> --> - 4.True or false: a code editor sends pages over the net. (a) False (b) True
- 5.🔢 In a basic web page file, which comes first: “<!DOCTYPE html>” or “<head>”? (a) <!DOCTYPE html> (b) <head>
-
6.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Space Facts</title>
</head>
<body>
<h1>All about me</h1>
<p>Mars is red.</p>
</body>
</html> (a) All about me (b) Space Facts (c) Mars is red. (d) body -
7.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="map.png" alt="Map of India" width="350"> (a) Map of India (b) Birthday cake (c) map.png (d) width - 8.🔢 In a basic web page file, which comes LAST? (a) <body> (b) </head> (c) </html> (d) <!DOCTYPE html>
- 9.📄 What is the first line of an HTML5 page? (a) <html> (b) <!DOCTYPE html> (c) <head> (d) <body>
- 10.Which of these goes in the body? (a) <title> (b) <style> (c) <meta charset="utf-8"> (d) <h1>
- 11.🏷️ Is </h1> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
-
12.📝 How many paragraphs does this code make?
<p>Cricket is fun.</p>
<p>The red kite</p>
<p>Fun facts</p> - 13.🔠 Which tag is used for the main title on a page? (a) <p> (b) <br> (c) <h1> (d) <h6>
- 14.💬 Why do coders write comments? (a) to add colour (b) to leave notes (c) to make links (d) to show pictures
- 15.True or false: HTML on its own cannot keep a high score. (a) True (b) False
-
16.💬 How many paragraphs show on the page?
<!-- <p>I love mangoes.</p> -->
<p>My pets</p>
<p>Cricket is fun.</p>
<!-- <p>The red kite</p> -->
<!-- <p>Hello, world!</p> --> - 17.🌐 Which one is where we type code? (a) a web browser (b) a code editor (c) a web server
- 18.Which of these has a closing tag? (a) <img> (b) <meta> (c) <br> (d) <b>
- 19.🔢 In a basic web page file, which comes first: “<body>” or “<html>”? (a) <html> (b) <body>
- 20.🔠 How many heading levels does HTML have? (a) 10 (b) 4 (c) 3 (d) 6
- 21.True or false: <p> is an empty tag. (a) True (b) False
- 22.Which of these goes in the head? (a) <p> (b) <link rel="stylesheet"> (c) <table> (d) <img>
-
23.🔗 Where does this link open?
<a href="art.html" target="_blank">Play games</a> (a) in the same tab (b) in a new tab - 24.Which of these goes in the body? (a) <meta charset="utf-8"> (b) <title> (c) <style> (d) <img>
-
25.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="fort.jpg" alt="An old fort" width="350"> (a) A tiger asleep (b) width (c) fort.jpg (d) An old fort -
26.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="tiger.jpg" alt="A tiger asleep" width="100"> (a) width (b) tiger.jpg (c) A tiger asleep (d) A red kite -
27.📝 How many paragraphs does this code make?
<p>Cricket is fun.</p>
<h2>My pets</h2>
<p>My pets</p>
<p>Cricket is fun.</p> - 28.Which of these is an empty tag? (a) <ul> (b) <p> (c) <li> (d) <hr>
- 29.💬 Can anyone read your comments by viewing the page source? (a) No (b) Yes
- 30.🧩 An opening tag + content + a closing tag together make an ___. (a) attribute (b) editor (c) address (d) element
- 31.🔗 Which tag makes a clickable link? (a) <p> (b) <img> (c) <a> (d) <link>
- 32.🖼️ Which attribute of <img> is read by screen readers? (a) src (b) height (c) width (d) alt
-
33.🔗 Which words do you click on?
<a href="maths.html">About us</a> (a) Contact us (b) href (c) maths.html (d) About us - 34.Which of these has a closing tag? (a) <hr> (b) <img> (c) <li> (d) <br>
- 35.🌍 Which program shows a web page to us? (a) a web browser (b) a music player (c) a paint program (d) a calculator
- 36.💬 How does an HTML comment end? (a) >> (b) */ (c) --> (d) //
-
37.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Space Facts</title>
</head>
<body>
<h1>My drawings</h1>
<p>Here is my best one.</p>
</body>
</html> (a) My drawings (b) body (c) Space Facts (d) Here is my best one. - 38.🔠 Which heading shows the SMALLEST text: <h2>, <h5>, <h1> or <h4>? (a) <h2> (b) <h5> (c) <h1> (d) <h4>
-
39.📋 How many items does this list show?
<ol>
<li>Jamun</li>
<li>Grapes</li>
</ol> - 40.True or false: in <img>, alt is read by screen readers. (a) False (b) True
Answer key
- line 3
- <h1>
- 1
- False
- <!DOCTYPE html>
- All about me
- Map of India
- </html>
- <!DOCTYPE html>
- <h1>
- a closing tag
- 3
- <h1>
- to leave notes
- True
- 2
- a code editor
- <b>
- <html>
- 6
- False
- <link rel="stylesheet">
- in a new tab
- <img>
- An old fort
- A tiger asleep
- 3
- <hr>
- Yes
- element
- <a>
- alt
- About us
- <li>
- a web browser
- -->
- My drawings
- <h5>
- 2
- True
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids