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 leave notes (b) to make links (c) to show pictures (d) to add colour
- 2.🔠 Which heading shows the SMALLEST text: <h5>, <h1>, <h4> or <h2>? (a) <h5> (b) <h1> (c) <h2> (d) <h4>
-
3.🔠 How many headings are in this code?
<h1>Fun facts</h1>
<p>Rain today</p>
<p>The red kite</p>
<h2>My pets</h2> - 4.💬 How does an HTML comment end? (a) */ (b) >> (c) // (d) -->
-
5.📝 How many paragraphs does this code make?
<p>Our school trip</p>
<p>I love mangoes.</p>
<p>Cricket is fun.</p>
<p>I love mangoes.</p>
<p>Good morning!</p> - 6.📄 Can HTML on its own add pictures to a page? (a) No (b) Yes
- 7.📋 Which list suits a shopping list in any order? (a) <ul> (b) <br> (c) <hr> (d) <ol>
- 8.True or false: in <img>, src shows if the image fails. (a) True (b) False
-
9.📝 How many paragraphs does this code make?
<p>I love mangoes.</p>
<p>Cricket is fun.</p>
<p>Good morning!</p>
<p>I love mangoes.</p>
<h2>I love mangoes.</h2>
<p>Cricket is fun.</p> - 10.📝 What does <br> do? (a) starts a new line (b) makes text bold (c) adds a picture (d) makes a list
- 11.🌐 Which one turns HTML into a page? (a) a code editor (b) a web browser (c) a web server
-
12.📋 How many items does this list show?
<ol>
<li>Guava</li>
<li>Grapes</li>
</ol> - 13.💬 Does the browser show comments on the page? (a) Yes (b) No
- 14.🔡 Are HTML tag names usually written in small letters? (a) No (b) Yes
- 15.🔗 Which attribute holds the address of a link? (a) href (b) src (c) alt (d) id
-
16.💬 How many paragraphs show on the page?
<p>My best friend</p>
<!-- <p>My pets</p> -->
<p>Our school trip</p> - 17.📛 In <a href="x.html">, what is href? (a) a comment (b) a closing tag (c) an element name (d) an attribute
- 18.True or false: <table> goes in the head. (a) False (b) True
- 19.📋 Which list tag lists things in any order? (a) <ol> (b) <li> (c) <ul>
-
20.📝 On how many lines does the browser show this paragraph?
<p>Birds sing<br>Sky is blue</p> - 21.🔠 Which heading shows the BIGGEST text: <h4>, <h5>, <h3> or <h6>? (a) <h3> (b) <h4> (c) <h6> (d) <h5>
-
22.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Space Facts</title>
</head>
<body>
<h1>Planets</h1>
<p>Here is my best one.</p>
</body>
</html> (a) body (b) Here is my best one. (c) Planets (d) Space Facts - 23.📄 Can HTML on its own make links to pages? (a) No (b) Yes
-
24.💬 How many paragraphs show on the page?
<p>Our school trip</p>
<p>The red kite</p>
<!-- <p>Fun facts</p> --> - 25.📋 Which list tag is one item of a list? (a) <ul> (b) <ol> (c) <li>
- 26.True or false: <style> goes in the body. (a) False (b) True
- 27.🔠 Are headings shown in bold by default? (a) No (b) Yes
-
28.📋 What number does the browser show next to “Guava”?
<ol start="5">
<li>Jamun</li>
<li>Guava</li>
<li>Grapes</li>
</ol> -
29.🔍 Which line is missing its closing tag?
line 1: <i>Cricket is fun.
line 2: <small>The red kite</small>
line 3: <em>Hello, world!</em> (a) line 3 (b) line 1 (c) line 2 -
30.📋 What number does the browser show next to “Papaya”?
<ol>
<li>Grapes</li>
<li>Papaya</li>
<li>Banana</li>
</ol> -
31.💬 How many paragraphs show on the page?
<!-- <p>My pets</p> -->
<!-- <p>Rain today</p> -->
<p>The red kite</p>
<p>My best friend</p>
<!-- <p>Good morning!</p> --> - 32.True or false: <ol> shows 1, 2, 3 numbers. (a) False (b) True
-
33.🔗 Where does this link open?
<a href="contact.html">School news</a> (a) in a new tab (b) in the same tab - 34.True or false: <ul> lists things in any order. (a) False (b) True
- 35.🔠 Which heading shows the BIGGEST text: <h3>, <h6>, <h1> or <h4>? (a) <h6> (b) <h1> (c) <h4> (d) <h3>
- 36.🌐 Which one colours code to help us? (a) a web server (b) a web browser (c) a code editor
-
37.💬 How many paragraphs show on the page?
<!-- <p>Cricket is fun.</p> -->
<!-- <p>Hello, world!</p> -->
<!-- <p>My pets</p> -->
<p>Good morning!</p> - 38.🌐 Which one is where we type code? (a) a web browser (b) a web server (c) a code editor
- 39.Which of these goes in the body? (a) <meta charset="utf-8"> (b) <img> (c) <link rel="stylesheet"> (d) <title>
- 40.True or false: in <img>, height shows if the image fails. (a) False (b) True
Answer key
- to leave notes
- <h5>
- 2
- -->
- 5
- Yes
- <ul>
- False
- 5
- starts a new line
- a web browser
- 2
- No
- Yes
- href
- 2
- an attribute
- False
- <ul>
- 2
- <h3>
- Planets
- Yes
- 2
- <li>
- False
- Yes
- 6
- line 1
- 2
- 2
- True
- in the same tab
- True
- <h1>
- a code editor
- 1
- a code editor
- <img>
- False
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids