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.💬 Why do coders write comments? (a) to make links (b) to add colour (c) to show pictures (d) to leave notes
- 2.True or false: in <img>, width describes the picture. (a) True (b) False
-
3.📝 How many paragraphs does this code make?
<p>My best friend</p>
<p>Rain today</p>
<p>The red kite</p>
<p>The red kite</p>
<p>The red kite</p> - 4.🔠 Which tag is the least important heading? (a) <h6> (b) <p> (c) <h1> (d) <h3>
- 5.💬 How does an HTML comment start? (a) // (b) /* (c) <!-- (d) #
- 6.🔡 Are HTML tag names usually written in small letters? (a) Yes (b) No
-
7.📝 On how many lines does the browser show this paragraph?
<p>Birds sing<br>Rivers flow<br>Roses are red</p> -
8.📋 What number does the browser show next to “Grapes”?
<ol>
<li>Papaya</li>
<li>Orange</li>
<li>Banana</li>
<li>Grapes</li>
<li>Jamun</li>
</ol> - 9.True or false: <ul> is an ordered list. (a) False (b) True
- 10.📋 Which list shows the steps of a recipe best? (a) <ul> (b) <ol> (c) <hr> (d) <br>
- 11.🖼️ Which attribute of <img> is read by screen readers? (a) alt (b) width (c) src (d) height
-
12.📋 How many items does this list show?
<ol>
<li>Litchi</li>
<li>Banana</li>
<li>Mango</li>
</ol> - 13.🔠 Which heading shows the BIGGEST text: <h6>, <h4>, <h3> or <h5>? (a) <h5> (b) <h3> (c) <h4> (d) <h6>
-
14.💬 Which text will NOT show on the page?
<!-- <p>The red kite</p> -->
<p>Cricket is fun.</p>
<p>My best friend</p> (a) Cricket is fun. (b) My best friend (c) The red kite -
15.🔗 Where does this link open?
<a href="maths.html" target="_blank">School news</a> (a) in a new tab (b) in the same tab - 16.🖼️ Which attribute of <img> names the picture file? (a) src (b) height (c) alt (d) width
- 17.Which of these goes in the head? (a) <a> (b) <h1> (c) <img> (d) <title>
-
18.💬 How many paragraphs show on the page?
<!-- <p>The red kite</p> -->
<!-- <p>Fun facts</p> -->
<p>Hello, world!</p> - 19.🔠 How many <h1> headings should a page usually have? (a) 1 (b) 6 (c) 10 (d) 3
-
20.🖼️ How many pixels wide is the picture drawn?
<img src="kite.png" alt="A red kite" width="150"> -
21.🔠 How many headings are in this code?
<h1>Rain today</h1>
<h2>Good morning!</h2>
<p>Fun facts</p>
<p>Our school trip</p> -
22.🔠 How many headings are in this code?
<h1>Good morning!</h1>
<p>Good morning!</p>
<p>Our school trip</p>
<p>I love mangoes.</p>
<p>The red kite</p> - 23.Which of these has a closing tag? (a) <input> (b) <ul> (c) <img> (d) <meta>
-
24.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Class 7 Blog</title>
</head>
<body>
<h1>Match report</h1>
<p>I like to read.</p>
</body>
</html> (a) Match report (b) Class 7 Blog (c) I like to read. (d) body - 25.Which of these goes in the head? (a) <a> (b) <meta charset="utf-8"> (c) <h1> (d) <table>
-
26.💬 Which text will NOT show on the page?
<p>Hello, world!</p>
<!-- <p>The red kite</p> -->
<p>Fun facts</p> (a) The red kite (b) Hello, world! (c) Fun facts -
27.🔍 One closing tag is missing. Which one?
<small>Good morning!
<h2>My pets</h2>
<u>I love mangoes.</u> (a) </u> (b) </i> (c) </h2> (d) </small> - 28.True or false: in <img>, alt tells which image to load. (a) False (b) True
- 29.🔠 Are headings shown in bold by default? (a) No (b) Yes
- 30.Which of these goes in the head? (a) <link rel="stylesheet"> (b) <table> (c) <p> (d) <h1>
-
31.🔍 One closing tag is missing. Which one?
<h1>I love mangoes.</h1>
<h3>Hello, world!
<h2>Good morning!</h2> (a) </h1> (b) </h2> (c) </small> (d) </h3> - 32.🔢 In a basic web page file, which comes LAST? (a) <head> (b) </html> (c) </head> (d) <!DOCTYPE html>
-
33.💬 How many paragraphs show on the page?
<!-- <p>Hello, world!</p> -->
<!-- <p>My best friend</p> -->
<p>Our school trip</p> - 34.Which of these is a closing tag? (a) <body> (b) <li> (c) <p> (d) </p>
- 35.🔠 Which heading shows the SMALLEST text: <h1>, <h6>, <h2> or <h4>? (a) <h2> (b) <h4> (c) <h6> (d) <h1>
- 36.📝 Does <b> have a closing tag, or is it an empty tag? (a) has a closing tag (b) an empty tag
-
37.🖼️ Which picture file does the browser load?
<img src="tiger.jpg" alt="A tiger asleep" width="200"> (a) map.png (b) A tiger asleep (c) kite.png (d) tiger.jpg - 38.📄 Can HTML on its own add up two numbers? (a) Yes (b) No
-
39.💬 How many paragraphs show on the page?
<p>The red kite</p>
<p>I love mangoes.</p>
<!-- <p>Rain today</p> --> -
40.📋 What number does the browser show next to “Banana”?
<ol start="8">
<li>Papaya</li>
<li>Jamun</li>
<li>Guava</li>
<li>Banana</li>
<li>Orange</li>
</ol>
Answer key
- to leave notes
- False
- 5
- <h6>
- <!--
- Yes
- 3
- 4
- False
- <ol>
- alt
- 3
- <h3>
- The red kite
- in a new tab
- src
- <title>
- 1
- 1
- 150
- 2
- 1
- <ul>
- Match report
- <meta charset="utf-8">
- The red kite
- </small>
- False
- Yes
- <link rel="stylesheet">
- </h3>
- </html>
- 1
- </p>
- <h6>
- has a closing tag
- tiger.jpg
- No
- 2
- 11
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids