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 does <hr> draw? (a) a line across the page (b) a table (c) a link (d) a picture
-
2.🔠 How many headings are in this code?
<h1>Cricket is fun.</h1>
<p>Hello, world!</p>
<p>My pets</p> - 3.🔢 In a basic web page file, which comes first: “<head>” or “</body>”? (a) <head> (b) </body>
- 4.Which of these has a closing tag? (a) <meta> (b) <p> (c) <img> (d) <hr>
- 5.🔗 Which attribute holds the address of a link? (a) href (b) alt (c) src (d) id
-
6.💬 How many paragraphs show on the page?
<!-- <p>My pets</p> -->
<p>Hello, world!</p>
<p>Rain today</p> - 7.🔠 How many heading levels does HTML have? (a) 6 (b) 3 (c) 4 (d) 10
- 8.🔠 Which heading shows the SMALLEST text: <h5>, <h6>, <h4> or <h1>? (a) <h6> (b) <h5> (c) <h4> (d) <h1>
- 9.True or false: a web server stores a website’s files. (a) False (b) True
- 10.💬 Why do coders write comments? (a) to leave notes (b) to make links (c) to show pictures (d) to add colour
- 11.🔠 Which heading shows the BIGGEST text: <h4>, <h6>, <h1> or <h2>? (a) <h2> (b) <h6> (c) <h4> (d) <h1>
- 12.🔠 Which heading shows the BIGGEST text: <h2>, <h5>, <h4> or <h1>? (a) <h4> (b) <h2> (c) <h5> (d) <h1>
-
13.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>My Hobbies</title>
</head>
<body>
<h1>Planets</h1>
<p>I like to read.</p>
</body>
</html> (a) Planets (b) My Hobbies (c) I like to read. (d) body -
14.📝 How many paragraphs does this code make?
<p>My best friend</p>
<p>Fun facts</p>
<p>Cricket is fun.</p> -
15.💬 How many paragraphs show on the page?
<p>My best friend</p>
<!-- <p>Fun facts</p> -->
<p>The red kite</p>
<p>Rain today</p>
<p>I love mangoes.</p> - 16.🔠 Which heading shows the SMALLEST text: <h4>, <h1>, <h2> or <h5>? (a) <h2> (b) <h4> (c) <h1> (d) <h5>
-
17.🔠 How many headings are in this code?
<h1>Cricket is fun.</h1>
<h4>My best friend</h4>
<h3>Good morning!</h3>
<h3>My best friend</h3> - 18.🖼️ Which attribute of <img> is read by screen readers? (a) src (b) alt (c) height (d) width
- 19.🌍 Which program shows a web page to us? (a) a web browser (b) a paint program (c) a calculator (d) a music player
- 20.🏷️ Which is the closing tag for <b>? (a) </b> (b) <b> (c) <b/> (d) <\b>
- 21.📄 Where does <table> go: in the head or in the body? (a) in the body (b) in the head
- 22.True or false: HTML on its own can count button clicks. (a) True (b) False
- 23.🔗 Which code links to about.html? (a) <a src="about.html"> (b) <link about.html> (c) <a alt="about.html"> (d) <a href="about.html">
- 24.🔠 Which heading shows the BIGGEST text: <h3>, <h1>, <h6> or <h2>? (a) <h2> (b) <h6> (c) <h1> (d) <h3>
- 25.🏷️ What does a closing tag have that an opening tag does not? (a) a dollar $ (b) a dot . (c) a slash / (d) a hash #
- 26.🔠 Which heading shows the BIGGEST text: <h2>, <h5>, <h1> or <h3>? (a) <h5> (b) <h2> (c) <h3> (d) <h1>
- 27.Which of these has a closing tag? (a) <h1> (b) <hr> (c) <meta> (d) <br>
- 28.Which of these is an opening tag? (a) </li> (b) </p> (c) </body> (d) <h1>
- 29.🏷️ Is </title> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
- 30.🌐 Which one shows line numbers? (a) a code editor (b) a web server (c) a web browser
- 31.📄 Where does <style> go: in the head or in the body? (a) in the head (b) in the body
- 32.🔗 What does target="_blank" do to a link? (a) opens it in a new tab (b) makes it blank (c) makes it bold (d) hides the link
- 33.🖼️ Why do we add alt text to an image? (a) to describe the image (b) to colour it (c) to load it faster (d) to make it bigger
-
34.🔍 Which line is missing its closing tag?
line 1: <i>The red kite
line 2: <h2>I love mangoes.</h2>
line 3: <strong>Hello, world!</strong> (a) line 3 (b) line 2 (c) line 1 -
35.🔗 Which address opens when you click this link?
<a href="quiz.html">Play games</a> (a) about.html (b) games.html (c) Play games (d) quiz.html -
36.💬 Which text will NOT show on the page?
<p>My pets</p>
<!-- <p>My best friend</p> -->
<p>Fun facts</p>
<p>Rain today</p> (a) My best friend (b) My pets (c) Fun facts (d) Rain today -
37.🔗 Which address opens when you click this link?
<a href="https://example.com">Contact us</a> (a) https://example.com (b) art.html (c) Contact us (d) maths.html -
38.🔗 Which address opens when you click this link?
<a href="about.html">Play games</a> (a) https://example.com (b) contact.html (c) Play games (d) about.html - 39.True or false: <ul> goes in the head. (a) False (b) True
-
40.📋 How many items does this list show?
<ol>
<li>Grapes</li>
<li>Jamun</li>
<li>Guava</li>
<li>Mango</li>
</ol>
Answer key
- a line across the page
- 1
- <head>
- <p>
- href
- 2
- 6
- <h6>
- True
- to leave notes
- <h1>
- <h1>
- Planets
- 3
- 4
- <h5>
- 4
- alt
- a web browser
- </b>
- in the body
- False
- <a href="about.html">
- <h1>
- a slash /
- <h1>
- <h1>
- <h1>
- a closing tag
- a code editor
- in the head
- opens it in a new tab
- to describe the image
- line 1
- quiz.html
- My best friend
- https://example.com
- about.html
- False
- 4
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids