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 is a closing tag? (a) <b> (b) <h1> (c) </li> (d) <p>
- 2.🖼️ Which attribute of <img> describes the picture? (a) height (b) src (c) width (d) alt
-
3.🔗 Where does this link open?
<a href="contact.html">Visit the site</a> (a) in the same tab (b) in a new tab - 4.💬 How does an HTML comment end? (a) --> (b) // (c) */ (d) >>
-
5.🖼️ How many pixels wide is the picture drawn?
<img src="bus.jpg" alt="Our school bus" width="50"> -
6.💬 How many paragraphs show on the page?
<!-- <p>The red kite</p> -->
<!-- <p>Hello, world!</p> -->
<p>Fun facts</p>
<!-- <p>I love mangoes.</p> -->
<!-- <p>Our school trip</p> --> -
7.💬 Which text will NOT show on the page?
<!-- <p>My pets</p> -->
<p>The red kite</p>
<p>Cricket is fun.</p> (a) The red kite (b) Cricket is fun. (c) My pets - 8.🔠 Which heading shows the SMALLEST text: <h1>, <h5>, <h2> or <h3>? (a) <h2> (b) <h5> (c) <h3> (d) <h1>
- 9.🔠 Which tag is used for the main title on a page? (a) <h6> (b) <p> (c) <br> (d) <h1>
- 10.True or false: a web browser colours code to help us. (a) False (b) True
- 11.🔍 Which is the odd one out? (a) saves our .html files (b) shows line numbers (c) is where we type code (d) shows pages from the web
-
12.📝 How many paragraphs does this code make?
<p>Fun facts</p>
<h2>Hello, world!</h2>
<p>I love mangoes.</p>
<p>The red kite</p>
<p>Good morning!</p>
<p>My pets</p> - 13.🖼️ Does <img> need a closing tag? (a) No (b) Yes
- 14.🔗 Which code links to about.html? (a) <a src="about.html"> (b) <a alt="about.html"> (c) <link about.html> (d) <a href="about.html">
- 15.Which of these is an opening tag? (a) </li> (b) </body> (c) </p> (d) <body>
-
16.📋 What number does the browser show next to “Mango”?
<ol>
<li>Papaya</li>
<li>Grapes</li>
<li>Mango</li>
<li>Banana</li>
</ol> - 17.True or false: a web server answers page requests. (a) True (b) False
- 18.True or false: <link rel="stylesheet"> goes in the head. (a) True (b) False
- 19.🔠 Which heading shows the SMALLEST text: <h4>, <h1>, <h5> or <h6>? (a) <h1> (b) <h6> (c) <h4> (d) <h5>
-
20.🔗 Which address opens when you click this link?
<a href="quiz.html">Contact us</a> (a) quiz.html (b) Contact us (c) about.html (d) games.html -
21.🔠 How many headings are in this code?
<h1>Our school trip</h1>
<h3>Hello, world!</h3>
<h2>Cricket is fun.</h2>
<h2>Cricket is fun.</h2>
<h3>Hello, world!</h3> - 22.True or false: HTML on its own can add pictures to a page. (a) True (b) False
- 23.🏷️ Is <p> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
- 24.📝 Does <meta> have a closing tag, or is it an empty tag? (a) has a closing tag (b) an empty tag
- 25.🏷️ Which is the closing tag for <h3>? (a) <\h3> (b) </h3> (c) <h3/> (d) <h3>
- 26.💬 How does an HTML comment start? (a) // (b) # (c) <!-- (d) /*
-
27.📋 Does this list show bullets or numbers?
<ol>
<li>Papaya</li>
<li>Orange</li>
<li>Jamun</li>
</ol> (a) bullets (b) numbers -
28.🔍 Which line is missing its closing tag?
line 1: <p>Rain today
line 2: <h2>My pets</h2>
line 3: <h3>The red kite</h3> (a) line 3 (b) line 1 (c) line 2 - 29.📄 Which part holds everything you see on the page? (a) the head (b) the doctype (c) the body (d) the title
- 30.True or false: a web browser has an address bar. (a) True (b) False
-
31.🔠 How many headings are in this code?
<h1>Our school trip</h1>
<h4>Hello, world!</h4>
<h3>My best friend</h3>
<p>The red kite</p> -
32.🔍 One closing tag is missing. Which one?
<em>Our school trip
<p>My pets</p>
<h1>Good morning!</h1> (a) </b> (b) </p> (c) </em> (d) </h1> -
33.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Space Facts</title>
</head>
<body>
<h1>My drawings</h1>
<p>I like to read.</p>
</body>
</html> (a) I like to read. (b) My drawings (c) body (d) Space Facts -
34.📋 How many items does this list show?
<ol>
<li>Litchi</li>
<li>Jamun</li>
<li>Banana</li>
<li>Guava</li>
<li>Orange</li>
<li>Papaya</li>
</ol> - 35.🖼️ Which attribute of <img> is read by screen readers? (a) height (b) width (c) src (d) alt
-
36.📋 Does this list show bullets or numbers?
<ul>
<li>Mango</li>
<li>Banana</li>
<li>Guava</li>
</ul> (a) numbers (b) bullets -
37.📋 What number does the browser show next to “Litchi”?
<ol>
<li>Orange</li>
<li>Litchi</li>
<li>Papaya</li>
<li>Guava</li>
<li>Banana</li>
</ol> -
38.📋 How many items does this list show?
<ol>
<li>Mango</li>
<li>Orange</li>
<li>Banana</li>
<li>Jamun</li>
<li>Litchi</li>
<li>Grapes</li>
</ol> -
39.🔗 Which address opens when you click this link?
<a href="news.html">About us</a> (a) About us (b) news.html (c) games.html (d) quiz.html -
40.📋 What number does the browser show next to “Papaya”?
<ol start="6">
<li>Grapes</li>
<li>Papaya</li>
<li>Banana</li>
<li>Litchi</li>
<li>Mango</li>
</ol>
Answer key
- </li>
- alt
- in the same tab
- -->
- 50
- 1
- My pets
- <h5>
- <h1>
- False
- shows pages from the web
- 5
- No
- <a href="about.html">
- <body>
- 3
- True
- True
- <h6>
- quiz.html
- 5
- True
- an opening tag
- an empty tag
- </h3>
- <!--
- numbers
- line 1
- the body
- True
- 3
- </em>
- My drawings
- 6
- alt
- bullets
- 2
- 6
- news.html
- 7
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids