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.True or false: a web server colours code to help us. (a) True (b) False
- 2.🏷️ Which is the closing tag for <h2>? (a) <h2> (b) <\h2> (c) <h2/> (d) </h2>
-
3.🔗 Which words do you click on?
<a href="contact.html">Contact us</a> (a) href (b) contact.html (c) Contact us (d) Visit the site - 4.Which of these is an empty tag? (a) <b> (b) <p> (c) <ul> (d) <meta>
- 5.🏷️ Which is the closing tag for <em>? (a) <em> (b) <em/> (c) </em> (d) <\em>
- 6.🌐 Which one shows line numbers? (a) a web server (b) a web browser (c) a code editor
- 7.🔠 Which heading shows the BIGGEST text: <h3>, <h5>, <h4> or <h2>? (a) <h5> (b) <h2> (c) <h3> (d) <h4>
- 8.📛 In <a href="x.html">, what is href? (a) a closing tag (b) a comment (c) an attribute (d) an element name
-
9.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>My Hobbies</title>
</head>
<body>
<h1>Welcome!</h1>
<p>I like to read.</p>
</body>
</html> (a) Welcome! (b) I like to read. (c) My Hobbies (d) index.html -
10.💬 How many paragraphs show on the page?
<p>Our school trip</p>
<p>Cricket is fun.</p>
<!-- <p>I love mangoes.</p> -->
<!-- <p>Fun facts</p> -->
<!-- <p>My best friend</p> --> -
11.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="map.png" alt="Map of India" width="50"> (a) Map of India (b) map.png (c) width (d) Birthday cake -
12.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="bus.jpg" alt="Our school bus" width="350"> (a) bus.jpg (b) An old fort (c) width (d) Our school bus -
13.📝 How many paragraphs does this code make?
<p>My pets</p>
<h2>Our school trip</h2>
<p>I love mangoes.</p> -
14.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="map.png" alt="Map of India" width="200"> (a) width (b) Birthday cake (c) map.png (d) Map of India - 15.True or false: <ul> shows 1, 2, 3 numbers. (a) False (b) True
-
16.📝 How many paragraphs does this code make?
<p>I love mangoes.</p>
<p>My best friend</p>
<h2>Cricket is fun.</h2>
<p>The red kite</p>
<p>My best friend</p>
<p>I love mangoes.</p> -
17.🔠 How many headings are in this code?
<h1>Hello, world!</h1>
<h4>Cricket is fun.</h4>
<h4>Our school trip</h4> -
18.💬 How many paragraphs show on the page?
<!-- <p>Our school trip</p> -->
<p>Hello, world!</p>
<!-- <p>Good morning!</p> -->
<p>Fun facts</p> - 19.📋 Which list tag is an unordered list? (a) <li> (b) <ol> (c) <ul>
- 20.🔠 Are headings shown in bold by default? (a) No (b) Yes
- 21.📋 Which list tag shows bullet points? (a) <li> (b) <ul> (c) <ol>
- 22.True or false: a code editor opens web pages for us. (a) False (b) True
- 23.Which of these is an opening tag? (a) </h1> (b) </title> (c) <li> (d) </body>
- 24.🏷️ Which is the closing tag for <strong>? (a) <strong/> (b) </strong> (c) <strong> (d) <\strong>
- 25.💬 How does an HTML comment start? (a) # (b) /* (c) <!-- (d) //
- 26.💬 Does the browser show comments on the page? (a) Yes (b) No
-
27.🔍 Which line is missing its closing tag?
line 1: <p>Our school trip</p>
line 2: <em>The red kite
line 3: <strong>Fun facts</strong> (a) line 1 (b) line 2 (c) line 3 -
28.📝 On how many lines does the browser show this paragraph?
<p>Birds sing<br>Stars shine<br>Roses are red</p> -
29.🖼️ Which picture file does the browser load?
<img src="kite.png" alt="A red kite" width="400"> (a) cake.jpg (b) A red kite (c) map.png (d) kite.png - 30.🔠 Which heading shows the BIGGEST text: <h5>, <h1>, <h4> or <h2>? (a) <h5> (b) <h4> (c) <h1> (d) <h2>
-
31.📝 How many paragraphs does this code make?
<p>I love mangoes.</p>
<p>Good morning!</p>
<h2>My pets</h2>
<h2>Hello, world!</h2> - 32.📄 Where does <meta charset="utf-8"> go: in the head or in the body? (a) in the head (b) in the body
- 33.🖼️ Which attribute of <img> shows if the image fails? (a) alt (b) width (c) height (d) src
-
34.💬 How many paragraphs show on the page?
<!-- <p>Fun facts</p> -->
<p>My best friend</p>
<p>My pets</p>
<p>Our school trip</p> - 35.🔠 Which heading shows the SMALLEST text: <h2>, <h5>, <h1> or <h6>? (a) <h2> (b) <h1> (c) <h6> (d) <h5>
- 36.True or false: a web browser shows pages from the web. (a) False (b) True
-
37.💬 How many paragraphs show on the page?
<!-- <p>I love mangoes.</p> -->
<!-- <p>My pets</p> -->
<p>Good morning!</p> - 38.🏷️ Is <b> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
-
39.🖼️ How many pixels wide is the picture drawn?
<img src="kite.png" alt="A red kite" width="300"> - 40.🔗 Which attribute holds the address of a link? (a) href (b) id (c) alt (d) src
Answer key
- False
- </h2>
- Contact us
- <meta>
- </em>
- a code editor
- <h2>
- an attribute
- My Hobbies
- 2
- Map of India
- Our school bus
- 2
- Map of India
- False
- 5
- 3
- 2
- <ul>
- Yes
- <ul>
- False
- <li>
- </strong>
- <!--
- No
- line 2
- 3
- kite.png
- <h1>
- 2
- in the head
- alt
- 3
- <h6>
- True
- 1
- an opening tag
- 300
- href
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids