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.💬 How many paragraphs show on the page?
<!-- <p>The red kite</p> -->
<p>I love mangoes.</p>
<!-- <p>Hello, world!</p> -->
<!-- <p>Cricket is fun.</p> -->
<!-- <p>My pets</p> --> -
2.💬 Which text will NOT show on the page?
<!-- <p>My pets</p> -->
<p>The red kite</p>
<p>Cricket is fun.</p> (a) My pets (b) Cricket is fun. (c) The red kite -
3.💬 How many paragraphs show on the page?
<p>Hello, world!</p>
<p>My best friend</p>
<p>The red kite</p>
<!-- <p>My pets</p> --> -
4.🔗 Which address opens when you click this link?
<a href="https://example.com">Visit the site</a> (a) https://example.com (b) maths.html (c) art.html (d) Visit the site - 5.🔗 What does target="_blank" do to a link? (a) hides the link (b) opens it in a new tab (c) makes it blank (d) makes it bold
- 6.🔗 Which code links to about.html? (a) <link about.html> (b) <a href="about.html"> (c) <a alt="about.html"> (d) <a src="about.html">
-
7.💬 How many paragraphs show on the page?
<!-- <p>I love mangoes.</p> -->
<p>The red kite</p>
<p>Rain today</p> - 8.Which of these is true of a web browser? (a) has an address bar (b) answers page requests (c) stores a website’s files (d) saves our .html files
- 9.🔗 Which tag makes a clickable link? (a) <p> (b) <a> (c) <link> (d) <img>
-
10.📝 How many paragraphs does this code make?
<p>The red kite</p>
<p>My best friend</p>
<p>My pets</p> - 11.Which of these has a closing tag? (a) <input> (b) <ul> (c) <br> (d) <img>
- 12.Which of these has a closing tag? (a) <hr> (b) <input> (c) <meta> (d) <p>
-
13.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Art Gallery</title>
</head>
<body>
<h1>Match report</h1>
<p>We won by 5 runs.</p>
</body>
</html> (a) Art Gallery (b) body (c) Match report (d) We won by 5 runs. -
14.🔍 Which line is missing its closing tag?
line 1: <u>Cricket is fun.
line 2: <h2>The red kite</h2>
line 3: <em>Good morning!</em> (a) line 2 (b) line 3 (c) line 1 -
15.🔠 How many headings are in this code?
<h1>My pets</h1>
<h2>Good morning!</h2>
<p>Fun facts</p>
<p>Cricket is fun.</p>
<h3>Hello, world!</h3> - 16.True or false: <link rel="stylesheet"> goes in the head. (a) False (b) True
-
17.🔍 Which line is missing its closing tag?
line 1: <h2>Our school trip
line 2: <p>Fun facts</p>
line 3: <u>Cricket is fun.</u> (a) line 2 (b) line 1 (c) line 3 -
18.🔗 Which words do you click on?
<a href="art.html">Art corner</a> (a) School news (b) Art corner (c) art.html (d) href -
19.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="kite.png" alt="A red kite" width="300"> (a) Map of India (b) kite.png (c) A red kite (d) width -
20.🔍 Which line is missing its closing tag?
line 1: <h1>Good morning!</h1>
line 2: <p>Rain today</p>
line 3: <b>Hello, world! (a) line 1 (b) line 2 (c) line 3 -
21.🖼️ Which picture file does the browser load?
<img src="moon.png" alt="The full moon" width="300"> (a) bus.jpg (b) The full moon (c) moon.png (d) fort.jpg - 22.📄 Where does <title> go: in the head or in the body? (a) in the body (b) in the head
- 23.🔗 Which attribute holds the address of a link? (a) alt (b) src (c) href (d) id
-
24.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="map.png" alt="Map of India" width="50"> (a) map.png (b) width (c) Map of India (d) Birthday cake -
25.📝 On how many lines does the browser show this paragraph?
<p>Kites fly high<br>Sky is blue<br>Stars shine</p> -
26.🔠 How many headings are in this code?
<h1>Hello, world!</h1>
<h3>Rain today</h3>
<p>Rain today</p> - 27.🏷️ Which is the closing tag for <i>? (a) <i/> (b) </i> (c) <\i> (d) <i>
-
28.🔠 How many headings are in this code?
<h1>Hello, world!</h1>
<p>Good morning!</p>
<h3>Our school trip</h3>
<h4>I love mangoes.</h4>
<p>My pets</p> - 29.True or false: HTML on its own cannot make a form. (a) True (b) False
- 30.🔠 Are headings shown in bold by default? (a) No (b) Yes
- 31.📄 Where does <meta charset="utf-8"> go: in the head or in the body? (a) in the body (b) in the head
- 32.True or false: in <img>, width sets how wide it is. (a) False (b) True
- 33.🖼️ Which attribute of <img> sets how wide it is? (a) height (b) alt (c) width (d) src
- 34.📄 Where does the text of <title> appear? (a) on the browser tab (b) nowhere (c) at the bottom (d) in a big heading
- 35.🔠 Which tag is used for the main title on a page? (a) <h6> (b) <br> (c) <p> (d) <h1>
- 36.📝 What does <p> make? (a) a link (b) a paragraph (c) a picture (d) a table
-
37.📋 How many items does this list show?
<ul>
<li>Mango</li>
<li>Papaya</li>
</ul> - 38.💬 How does an HTML comment start? (a) /* (b) // (c) <!-- (d) #
- 39.True or false: in <img>, height names the picture file. (a) False (b) True
-
40.📝 How many paragraphs does this code make?
<p>I love mangoes.</p>
<p>Hello, world!</p>
<p>My pets</p>
Answer key
- 1
- My pets
- 3
- https://example.com
- opens it in a new tab
- <a href="about.html">
- 2
- has an address bar
- <a>
- 3
- <ul>
- <p>
- Match report
- line 1
- 3
- True
- line 1
- Art corner
- A red kite
- line 3
- moon.png
- in the head
- href
- Map of India
- 3
- 2
- </i>
- 3
- False
- Yes
- in the head
- True
- width
- on the browser tab
- <h1>
- a paragraph
- 2
- <!--
- False
- 3
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids