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 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
-
2.🔗 Where does this link open?
<a href="maths.html">Play games</a> (a) in a new tab (b) in the same tab -
3.💬 How many paragraphs show on the page?
<!-- <p>Good morning!</p> -->
<p>I love mangoes.</p>
<p>Our school trip</p>
<!-- <p>Hello, world!</p> --> - 4.True or false: <b> is an empty tag. (a) True (b) False
-
5.🖼️ Which picture file does the browser load?
<img src="moon.png" alt="The full moon" width="50"> (a) bus.jpg (b) The full moon (c) fort.jpg (d) moon.png - 6.🔠 Which tag is the least important heading? (a) <h3> (b) <h6> (c) <h1> (d) <p>
-
7.💬 Which text will NOT show on the page?
<p>Good morning!</p>
<!-- <p>I love mangoes.</p> -->
<p>My pets</p> (a) I love mangoes. (b) My pets (c) Good morning! - 8.Which of these is an opening tag? (a) </h1> (b) </title> (c) </b> (d) <p>
- 9.Which of these is true of a web server? (a) has an address bar (b) hosts websites online (c) opens web pages for us (d) shows line numbers
-
10.📝 On how many lines does the browser show this paragraph?
<p>Stars shine<br>Kites fly high</p> -
11.🔍 One closing tag is missing. Which one?
<strong>Cricket is fun.</strong>
<h2>My pets</h2>
<em>Fun facts (a) </strong> (b) </b> (c) </em> (d) </h2> -
12.📋 Does this list show bullets or numbers?
<ul>
<li>Guava</li>
<li>Mango</li>
</ul> (a) bullets (b) numbers -
13.🔗 Which words do you click on?
<a href="https://example.com">Play games</a> (a) href (b) https://example.com (c) About us (d) Play games -
14.💬 Which text will NOT show on the page?
<p>Cricket is fun.</p>
<!-- <p>Our school trip</p> -->
<p>My pets</p> (a) My pets (b) Our school trip (c) Cricket is fun. - 15.True or false: in <img>, height sets how tall it is. (a) False (b) True
- 16.🖼️ Which tag puts a picture on a page? (a) <p> (b) <a> (c) <img> (d) <pic>
- 17.True or false: in <img>, width shows if the image fails. (a) False (b) True
- 18.True or false: HTML on its own can pick a random number. (a) True (b) False
-
19.📝 On how many lines does the browser show this paragraph?
<p>Birds sing<br>Stars shine<br>Roses are red<br>Rivers flow</p> - 20.🏷️ Is </li> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
- 21.📋 Which list suits a shopping list in any order? (a) <ol> (b) <ul> (c) <br> (d) <hr>
- 22.📝 Does <br> have a closing tag, or is it an empty tag? (a) has a closing tag (b) an empty tag
-
23.📋 What number does the browser show next to “Jamun”?
<ol start="9">
<li>Banana</li>
<li>Mango</li>
<li>Orange</li>
<li>Jamun</li>
<li>Guava</li>
<li>Papaya</li>
</ol> - 24.🔠 Which heading shows the BIGGEST text: <h6>, <h5>, <h4> or <h1>? (a) <h4> (b) <h5> (c) <h1> (d) <h6>
- 25.True or false: HTML on its own can keep a high score. (a) False (b) True
-
26.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Art Gallery</title>
</head>
<body>
<h1>Planets</h1>
<p>Mars is red.</p>
</body>
</html> (a) Planets (b) body (c) Mars is red. (d) Art Gallery -
27.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="tiger.jpg" alt="A tiger asleep" width="200"> (a) A red kite (b) width (c) tiger.jpg (d) A tiger asleep - 28.🔠 Are headings shown in bold by default? (a) Yes (b) No
- 29.Which of these is a closing tag? (a) </h1> (b) <h1> (c) <b> (d) <title>
-
30.📝 How many paragraphs does this code make?
<p>Cricket is fun.</p>
<p>Our school trip</p>
<p>Rain today</p> - 31.🏷️ Every HTML tag starts with which sign? (a) { (b) < (c) [ (d) (
-
32.🔍 One closing tag is missing. Which one?
<strong>The red kite</strong>
<h1>Hello, world!
<p>Fun facts</p> (a) </small> (b) </h1> (c) </strong> (d) </p> - 33.🖼️ Which attribute of <img> is read by screen readers? (a) height (b) alt (c) src (d) width
- 34.Which of these is a closing tag? (a) <b> (b) <li> (c) <title> (d) </li>
- 35.📛 In <a href="x.html">, what is href? (a) a comment (b) an element name (c) a closing tag (d) an attribute
- 36.🏷️ Which is the closing tag for <h2>? (a) <h2> (b) <h2/> (c) </h2> (d) <\h2>
- 37.🌐 Which one saves our .html files? (a) a web server (b) a web browser (c) a code editor
-
38.🔠 How many headings are in this code?
<h1>My pets</h1>
<p>Good morning!</p>
<p>My best friend</p>
<p>I love mangoes.</p> - 39.🔠 Which heading shows the SMALLEST text: <h2>, <h4>, <h3> or <h5>? (a) <h3> (b) <h4> (c) <h5> (d) <h2>
- 40.🔠 Which heading shows the BIGGEST text: <h4>, <h1>, <h2> or <h6>? (a) <h4> (b) <h2> (c) <h6> (d) <h1>
Answer key
- to describe the image
- in the same tab
- 2
- False
- moon.png
- <h6>
- I love mangoes.
- <p>
- hosts websites online
- 2
- </em>
- bullets
- Play games
- Our school trip
- True
- <img>
- False
- False
- 4
- a closing tag
- <ul>
- an empty tag
- 12
- <h1>
- False
- Planets
- A tiger asleep
- Yes
- </h1>
- 3
- <
- </h1>
- alt
- </li>
- an attribute
- </h2>
- a code editor
- 1
- <h5>
- <h1>
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids