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 of these has a closing tag? (a) <img> (b) <br> (c) <p> (d) <meta>
- 2.🏷️ Is <li> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
-
3.🔍 Which line is missing its closing tag?
line 1: <u>The red kite</u>
line 2: <strong>Cricket is fun.</strong>
line 3: <em>Good morning! (a) line 2 (b) line 1 (c) line 3 - 4.🏷️ What does a closing tag have that an opening tag does not? (a) a slash / (b) a hash # (c) a dot . (d) a dollar $
- 5.True or false: in <img>, src describes the picture. (a) False (b) True
- 6.🖼️ Why do we add alt text to an image? (a) to make it bigger (b) to load it faster (c) to describe the image (d) to colour it
-
7.🖼️ How many pixels wide is the picture drawn?
<img src="bus.jpg" alt="Our school bus" width="100"> - 8.🔠 Which heading shows the BIGGEST text: <h4>, <h6>, <h3> or <h2>? (a) <h6> (b) <h4> (c) <h2> (d) <h3>
- 9.Which of these is true of a web server? (a) shows pages from the web (b) has an address bar (c) hosts websites online (d) opens web pages for us
- 10.🖼️ Which attribute of <img> sets how wide it is? (a) src (b) width (c) height (d) alt
-
11.📝 How many paragraphs does this code make?
<p>Rain today</p>
<p>Rain today</p>
<p>Good morning!</p> - 12.Which of these goes in the head? (a) <img> (b) <h1> (c) <ul> (d) <title>
-
13.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>Class 7 Blog</title>
</head>
<body>
<h1>Planets</h1>
<p>Thanks for visiting.</p>
</body>
</html> (a) Thanks for visiting. (b) index.html (c) Planets (d) Class 7 Blog - 14.Which of these is a closing tag? (a) <body> (b) <p> (c) </b> (d) <li>
-
15.📝 On how many lines does the browser show this paragraph?
<p>Roses are red<br>Rivers flow</p> - 16.🖼️ Which attribute of <img> names the picture file? (a) width (b) height (c) alt (d) src
- 17.🔍 Which is the odd one out? (a) saves our .html files (b) sends pages over the net (c) is where we type code (d) shows line numbers
- 18.Which of these is an empty tag? (a) <li> (b) <p> (c) <ul> (d) <hr>
-
19.📝 On how many lines does the browser show this paragraph?
<p>Sky is blue<br>Birds sing</p> -
20.💬 How many paragraphs show on the page?
<p>My pets</p>
<p>Fun facts</p>
<!-- <p>Hello, world!</p> --> -
21.🔠 How many headings are in this code?
<h1>Our school trip</h1>
<h4>The red kite</h4>
<h2>Hello, world!</h2>
<p>My pets</p> - 22.🔗 Which attribute holds the address of a link? (a) href (b) src (c) id (d) alt
-
23.📝 How many paragraphs does this code make?
<p>Hello, world!</p>
<p>Cricket is fun.</p>
<p>Good morning!</p>
<h2>My best friend</h2>
<p>Rain today</p>
<p>Our school trip</p> - 24.True or false: <li> lists things in any order. (a) False (b) True
-
25.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="fort.jpg" alt="An old fort" width="150"> (a) width (b) A tiger asleep (c) An old fort (d) fort.jpg -
26.🖼️ Which picture file does the browser load?
<img src="tiger.jpg" alt="A tiger asleep" width="400"> (a) A tiger asleep (b) kite.png (c) tiger.jpg (d) map.png - 27.🖼️ Which attribute of <img> tells which image to load? (a) width (b) height (c) src (d) alt
-
28.💬 How many paragraphs show on the page?
<p>Cricket is fun.</p>
<!-- <p>I love mangoes.</p> -->
<!-- <p>Rain today</p> -->
<!-- <p>Our school trip</p> -->
<p>The red kite</p> -
29.📋 Does this list show bullets or numbers?
<ul>
<li>Mango</li>
<li>Orange</li>
<li>Litchi</li>
</ul> (a) numbers (b) bullets -
30.📋 What number does the browser show next to “Papaya”?
<ol>
<li>Guava</li>
<li>Papaya</li>
<li>Mango</li>
</ol> -
31.🔗 Where does this link open?
<a href="games.html">Play games</a> (a) in the same tab (b) in a new tab - 32.💬 How does an HTML comment start? (a) <!-- (b) // (c) /* (d) #
-
33.📝 On how many lines does the browser show this paragraph?
<p>Birds sing<br>Stars shine<br>Kites fly high<br>Sky is blue</p> -
34.🔍 One closing tag is missing. Which one?
<u>Hello, world!
<p>Cricket is fun.</p>
<i>Fun facts</i> (a) </u> (b) </h1> (c) </i> (d) </p> -
35.💬 Which text will NOT show on the page?
<!-- <p>Cricket is fun.</p> -->
<p>Good morning!</p>
<p>My pets</p> (a) Cricket is fun. (b) My pets (c) Good morning! - 36.True or false: in <img>, width sets how wide it is. (a) True (b) False
- 37.📋 Which list suits a shopping list in any order? (a) <hr> (b) <ul> (c) <br> (d) <ol>
-
38.📋 How many items does this list show?
<ul>
<li>Mango</li>
<li>Grapes</li>
<li>Orange</li>
<li>Banana</li>
<li>Papaya</li>
<li>Litchi</li>
</ul> -
39.📋 How many items does this list show?
<ol>
<li>Jamun</li>
<li>Banana</li>
<li>Orange</li>
<li>Mango</li>
<li>Litchi</li>
</ol> -
40.💬 Which text will NOT show on the page?
<!-- <p>Good morning!</p> -->
<p>Hello, world!</p>
<p>My pets</p> (a) Good morning! (b) My pets (c) Hello, world!
Answer key
- <p>
- an opening tag
- line 3
- a slash /
- False
- to describe the image
- 100
- <h2>
- hosts websites online
- width
- 3
- <title>
- Class 7 Blog
- </b>
- 2
- src
- sends pages over the net
- <hr>
- 2
- 2
- 3
- href
- 5
- False
- An old fort
- tiger.jpg
- src
- 2
- bullets
- 2
- in the same tab
- <!--
- 4
- </u>
- Cricket is fun.
- True
- <ul>
- 6
- 5
- Good morning!
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids