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 tag is the least important heading? (a) <h6> (b) <h3> (c) <h1> (d) <p>
-
2.💬 How many paragraphs show on the page?
<p>My pets</p>
<!-- <p>Good morning!</p> -->
<p>My best friend</p>
<p>Cricket is fun.</p>
<p>Hello, world!</p> -
3.💬 Which text will NOT show on the page?
<p>My best friend</p>
<p>Cricket is fun.</p>
<p>Our school trip</p>
<!-- <p>Hello, world!</p> --> (a) Our school trip (b) My best friend (c) Cricket is fun. (d) Hello, world! - 4.🔗 What does target="_blank" do to a link? (a) hides the link (b) makes it bold (c) makes it blank (d) opens it in a new tab
- 5.📄 Where does <img> go: in the head or in the body? (a) in the body (b) in the head
-
6.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>Art Gallery</title>
</head>
<body>
<h1>Planets</h1>
<p>Mars is red.</p>
</body>
</html> (a) Art Gallery (b) Mars is red. (c) index.html (d) Planets - 7.🖼️ Why do we add alt text to an image? (a) to colour it (b) to describe the image (c) to make it bigger (d) to load it faster
-
8.🔍 Which line is missing its closing tag?
line 1: <h2>Cricket is fun.</h2>
line 2: <h1>My best friend</h1>
line 3: <em>I love mangoes. (a) line 3 (b) line 2 (c) line 1 -
9.🔍 Which line is missing its closing tag?
line 1: <i>Our school trip</i>
line 2: <strong>Cricket is fun.</strong>
line 3: <em>Rain today (a) line 2 (b) line 3 (c) line 1 -
10.💬 Which text will NOT show on the page?
<p>Fun facts</p>
<!-- <p>My pets</p> -->
<p>The red kite</p> (a) My pets (b) Fun facts (c) The red kite - 11.True or false: <p> is an empty tag. (a) False (b) True
-
12.📋 What number does the browser show next to “Jamun”?
<ol>
<li>Mango</li>
<li>Jamun</li>
<li>Papaya</li>
<li>Grapes</li>
</ol> -
13.📋 Does this list show bullets or numbers?
<ul>
<li>Jamun</li>
<li>Banana</li>
</ul> (a) bullets (b) numbers - 14.💬 Does the browser show comments on the page? (a) No (b) Yes
- 15.🔢 In a basic web page file, which comes FIRST? (a) <!DOCTYPE html> (b) </head> (c) <head> (d) </body>
-
16.🔠 How many headings are in this code?
<h1>Cricket is fun.</h1>
<h3>Hello, world!</h3>
<h3>Cricket is fun.</h3> -
17.📋 What number does the browser show next to “Mango”?
<ol start="6">
<li>Jamun</li>
<li>Grapes</li>
<li>Mango</li>
<li>Orange</li>
<li>Papaya</li>
<li>Guava</li>
</ol> - 18.🏷️ What does a closing tag have that an opening tag does not? (a) a slash / (b) a dollar $ (c) a dot . (d) a hash #
-
19.🔗 Which words do you click on?
<a href="games.html">Take the quiz</a> (a) Play games (b) Take the quiz (c) href (d) games.html - 20.📄 Which part holds everything you see on the page? (a) the body (b) the head (c) the doctype (d) the title
- 21.True or false: <title> goes in the head. (a) False (b) True
- 22.💬 How does an HTML comment start? (a) # (b) // (c) /* (d) <!--
- 23.🔠 Which heading shows the SMALLEST text: <h4>, <h3>, <h1> or <h5>? (a) <h4> (b) <h3> (c) <h1> (d) <h5>
- 24.📄 Where does <link rel="stylesheet"> go: in the head or in the body? (a) in the head (b) in the body
-
25.🖼️ Which picture file does the browser load?
<img src="bus.jpg" alt="Our school bus" width="300"> (a) Our school bus (b) tiger.jpg (c) fort.jpg (d) bus.jpg -
26.📋 How many items does this list show?
<ul>
<li>Litchi</li>
<li>Papaya</li>
</ul> -
27.🔗 Where does this link open?
<a href="contact.html">Visit the site</a> (a) in the same tab (b) in a new tab -
28.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Art Gallery</title>
</head>
<body>
<h1>Easy snacks</h1>
<p>Thanks for visiting.</p>
</body>
</html> (a) Art Gallery (b) Easy snacks (c) body (d) Thanks for visiting. - 29.🔠 Which heading shows the BIGGEST text: <h2>, <h1>, <h6> or <h5>? (a) <h6> (b) <h2> (c) <h5> (d) <h1>
- 30.True or false: in <img>, width sets how tall it is. (a) True (b) False
- 31.🏷️ Is </title> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
-
32.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>Riya’s Recipes</title>
</head>
<body>
<h1>Welcome!</h1>
<p>I like to read.</p>
</body>
</html> (a) index.html (b) Riya’s Recipes (c) Welcome! (d) I like to read. - 33.Which of these has a closing tag? (a) <hr> (b) <img> (c) <input> (d) <b>
-
34.🖼️ Which picture file does the browser load?
<img src="fort.jpg" alt="An old fort" width="400"> (a) kite.png (b) An old fort (c) tiger.jpg (d) fort.jpg - 35.🔠 Which heading shows the BIGGEST text: <h4>, <h1>, <h2> or <h5>? (a) <h5> (b) <h4> (c) <h1> (d) <h2>
- 36.📄 What is the first line of an HTML5 page? (a) <body> (b) <head> (c) <html> (d) <!DOCTYPE html>
- 37.📛 In <a href="x.html">, what is href? (a) an attribute (b) a closing tag (c) an element name (d) a comment
-
38.💬 How many paragraphs show on the page?
<!-- <p>Good morning!</p> -->
<!-- <p>Rain today</p> -->
<!-- <p>Fun facts</p> -->
<p>Cricket is fun.</p> -
39.🔠 How many headings are in this code?
<h1>Fun facts</h1>
<p>Rain today</p>
<h2>Fun facts</h2>
<h2>Good morning!</h2> -
40.📝 On how many lines does the browser show this paragraph?
<p>Rivers flow<br>Sky is blue</p>
Answer key
- <h6>
- 4
- Hello, world!
- opens it in a new tab
- in the body
- Art Gallery
- to describe the image
- line 3
- line 3
- My pets
- False
- 2
- bullets
- No
- <!DOCTYPE html>
- 3
- 8
- a slash /
- Take the quiz
- the body
- True
- <!--
- <h5>
- in the head
- bus.jpg
- 2
- in the same tab
- Easy snacks
- <h1>
- False
- a closing tag
- Riya’s Recipes
- <b>
- fort.jpg
- <h1>
- <!DOCTYPE html>
- an attribute
- 1
- 3
- 2
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids