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.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Space Facts</title>
</head>
<body>
<h1>Easy snacks</h1>
<p>Try this poha.</p>
</body>
</html> (a) Space Facts (b) Try this poha. (c) Easy snacks (d) body -
2.🔗 Which words do you click on?
<a href="quiz.html">Visit the site</a> (a) quiz.html (b) Maths fun (c) Visit the site (d) href -
3.📝 On how many lines does the browser show this paragraph?
<p>Birds sing<br>Sky is blue</p> -
4.🔠 How many headings are in this code?
<h1>I love mangoes.</h1>
<h2>The red kite</h2>
<p>My best friend</p> -
5.💬 How many paragraphs show on the page?
<p>Hello, world!</p>
<!-- <p>Good morning!</p> -->
<!-- <p>Rain today</p> --> -
6.📋 How many items does this list show?
<ul>
<li>Banana</li>
<li>Litchi</li>
</ul> - 7.Which of these goes in the body? (a) <img> (b) <link rel="stylesheet"> (c) <style> (d) <meta charset="utf-8">
- 8.🖼️ Which attribute of <img> describes the picture? (a) height (b) width (c) src (d) alt
-
9.🖼️ How many pixels wide is the picture drawn?
<img src="tiger.jpg" alt="A tiger asleep" width="350"> - 10.🔤 In “HTML”, what does the M stand for? (a) Modern (b) Mouse (c) Machine (d) Markup
-
11.📋 What number does the browser show next to “Litchi”?
<ol>
<li>Guava</li>
<li>Mango</li>
<li>Litchi</li>
</ol> -
12.💬 How many paragraphs show on the page?
<!-- <p>My best friend</p> -->
<!-- <p>Hello, world!</p> -->
<!-- <p>Fun facts</p> -->
<p>Good morning!</p>
<p>My pets</p> - 13.💬 Can anyone read your comments by viewing the page source? (a) Yes (b) No
-
14.📝 On how many lines does the browser show this paragraph?
<p>Birds sing<br>Roses are red<br>Stars shine<br>Rivers flow<br>Sky is blue</p> - 15.True or false: HTML on its own can run a game loop. (a) True (b) False
- 16.🔠 Which heading shows the BIGGEST text: <h4>, <h5>, <h1> or <h3>? (a) <h5> (b) <h4> (c) <h3> (d) <h1>
-
17.💬 Which text will NOT show on the page?
<!-- <p>My best friend</p> -->
<p>The red kite</p>
<p>Rain today</p>
<p>Good morning!</p> (a) Rain today (b) My best friend (c) Good morning! (d) The red kite - 18.📄 What is the first line of an HTML5 page? (a) <html> (b) <head> (c) <body> (d) <!DOCTYPE html>
- 19.🌐 Which one shows line numbers? (a) a web server (b) a web browser (c) a code editor
- 20.🌐 Which one sends pages over the net? (a) a web server (b) a web browser (c) a code editor
- 21.🔠 Which heading shows the SMALLEST text: <h1>, <h6>, <h3> or <h4>? (a) <h1> (b) <h3> (c) <h6> (d) <h4>
- 22.🔠 Which heading shows the BIGGEST text: <h1>, <h2>, <h5> or <h3>? (a) <h3> (b) <h2> (c) <h1> (d) <h5>
-
23.🔠 How many headings are in this code?
<h1>Hello, world!</h1>
<p>Cricket is fun.</p>
<p>My pets</p> - 24.🖼️ Which attribute of <img> sets how tall it is? (a) height (b) alt (c) width (d) src
- 25.🔗 What does target="_blank" do to a link? (a) makes it blank (b) opens it in a new tab (c) makes it bold (d) hides the link
- 26.💬 How does an HTML comment start? (a) # (b) // (c) /* (d) <!--
-
27.📝 How many paragraphs does this code make?
<p>Cricket is fun.</p>
<h2>I love mangoes.</h2>
<p>Cricket is fun.</p> - 28.🖼️ Which attribute of <img> is read by screen readers? (a) width (b) src (c) height (d) alt
-
29.💬 Which text will NOT show on the page?
<p>Rain today</p>
<p>Hello, world!</p>
<p>My best friend</p>
<!-- <p>My pets</p> --> (a) My best friend (b) Hello, world! (c) Rain today (d) My pets -
30.📋 What number does the browser show next to “Guava”?
<ol>
<li>Litchi</li>
<li>Papaya</li>
<li>Grapes</li>
<li>Guava</li>
<li>Orange</li>
<li>Mango</li>
</ol> -
31.🔍 Which line is missing its closing tag?
line 1: <b>Good morning!</b>
line 2: <h2>I love mangoes.</h2>
line 3: <strong>Rain today (a) line 1 (b) line 3 (c) line 2 - 32.📝 Does <li> have a closing tag, or is it an empty tag? (a) has a closing tag (b) an empty tag
-
33.💬 How many paragraphs show on the page?
<!-- <p>I love mangoes.</p> -->
<!-- <p>Hello, world!</p> -->
<p>Fun facts</p>
<p>The red kite</p>
<!-- <p>Rain today</p> --> - 34.🔢 In a basic web page file, which comes first: “</body>” or “<head>”? (a) </body> (b) <head>
- 35.🏷️ Which is the closing tag for <h3>? (a) <h3/> (b) </h3> (c) <h3> (d) <\h3>
- 36.🔠 Which tag is the least important heading? (a) <h1> (b) <h6> (c) <h3> (d) <p>
- 37.🖼️ Why do we add alt text to an image? (a) to colour it (b) to load it faster (c) to describe the image (d) to make it bigger
-
38.💬 How many paragraphs show on the page?
<!-- <p>I love mangoes.</p> -->
<!-- <p>The red kite</p> -->
<p>Cricket is fun.</p>
<!-- <p>Good morning!</p> --> -
39.💬 How many paragraphs show on the page?
<p>Rain today</p>
<!-- <p>My best friend</p> -->
<p>Our school trip</p>
<p>Cricket is fun.</p> - 40.Which of these goes in the head? (a) <p> (b) <ul> (c) <style> (d) <h1>
Answer key
- Easy snacks
- Visit the site
- 2
- 2
- 1
- 2
- <img>
- alt
- 350
- Markup
- 3
- 2
- Yes
- 5
- False
- <h1>
- My best friend
- <!DOCTYPE html>
- a code editor
- a web server
- <h6>
- <h1>
- 1
- height
- opens it in a new tab
- <!--
- 2
- alt
- My pets
- 4
- line 3
- has a closing tag
- 2
- <head>
- </h3>
- <h6>
- to describe the image
- 1
- 3
- <style>
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids