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 part holds everything you see on the page? (a) the title (b) the body (c) the doctype (d) the head
- 2.🏷️ Which is the closing tag for <small>? (a) <\small> (b) <small> (c) <small/> (d) </small>
-
3.💬 How many paragraphs show on the page?
<p>Hello, world!</p>
<p>My pets</p>
<p>I love mangoes.</p>
<!-- <p>Fun facts</p> -->
<p>Our school trip</p> -
4.🔗 Where does this link open?
<a href="news.html" target="_blank">Take the quiz</a> (a) in a new tab (b) in the same tab - 5.Which of these is true of a web server? (a) saves our .html files (b) hosts websites online (c) is where we type code (d) has an address bar
-
6.🔍 Which line is missing its closing tag?
line 1: <h3>Cricket is fun.
line 2: <em>Rain today</em>
line 3: <strong>The red kite</strong> (a) line 1 (b) line 2 (c) line 3 - 7.True or false: HTML on its own cannot make a form. (a) True (b) False
- 8.Which of these is true of a web server? (a) has an address bar (b) sends pages over the net (c) shows line numbers (d) colours code to help us
- 9.True or false: <style> goes in the head. (a) True (b) False
- 10.🏷️ Is <title> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
- 11.Which of these is an opening tag? (a) </title> (b) </h1> (c) <li> (d) </b>
-
12.🔍 Which line is missing its closing tag?
line 1: <h2>Cricket is fun.</h2>
line 2: <i>My best friend</i>
line 3: <em>Good morning! (a) line 1 (b) line 2 (c) line 3 -
13.💬 How many paragraphs show on the page?
<!-- <p>Rain today</p> -->
<!-- <p>Good morning!</p> -->
<p>My best friend</p>
<!-- <p>Our school trip</p> --> -
14.🔠 How many headings are in this code?
<h1>Hello, world!</h1>
<h2>Hello, world!</h2>
<h2>Hello, world!</h2> - 15.🖼️ Which tag puts a picture on a page? (a) <p> (b) <img> (c) <pic> (d) <a>
- 16.🖼️ Why do we add alt text to an image? (a) to load it faster (b) to make it bigger (c) to describe the image (d) to colour it
-
17.📝 On how many lines does the browser show this paragraph?
<p>Rivers flow<br>Kites fly high</p> - 18.🖼️ Which attribute of <img> names the picture file? (a) alt (b) height (c) width (d) src
- 19.True or false: in <img>, width tells which image to load. (a) True (b) False
- 20.🔗 Which code links to about.html? (a) <link about.html> (b) <a alt="about.html"> (c) <a src="about.html"> (d) <a href="about.html">
-
21.💬 How many paragraphs show on the page?
<!-- <p>Good morning!</p> -->
<p>My best friend</p>
<!-- <p>Fun facts</p> -->
<!-- <p>I love mangoes.</p> --> - 22.Which of these is a closing tag? (a) <body> (b) <p> (c) </h1> (d) <li>
- 23.🏷️ Is </b> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
- 24.📄 What is the first line of an HTML5 page? (a) <head> (b) <html> (c) <body> (d) <!DOCTYPE html>
-
25.🔍 Which line is missing its closing tag?
line 1: <b>Our school trip
line 2: <small>My pets</small>
line 3: <strong>The red kite</strong> (a) line 2 (b) line 1 (c) line 3 -
26.📝 How many paragraphs does this code make?
<p>My pets</p>
<p>The red kite</p>
<p>I love mangoes.</p> - 27.🖼️ Does <img> need a closing tag? (a) No (b) Yes
-
28.📋 Does this list show bullets or numbers?
<ol>
<li>Mango</li>
<li>Papaya</li>
<li>Litchi</li>
</ol> (a) bullets (b) numbers -
29.🔗 Which words do you click on?
<a href="games.html">Visit the site</a> (a) games.html (b) href (c) Maths fun (d) Visit the site -
30.💬 How many paragraphs show on the page?
<!-- <p>Fun facts</p> -->
<p>Hello, world!</p>
<p>My pets</p> - 31.💬 Does the browser show comments on the page? (a) Yes (b) No
- 32.📛 In <a href="x.html">, what is href? (a) an element name (b) a comment (c) a closing tag (d) an attribute
- 33.True or false: HTML on its own can make bullet lists. (a) True (b) False
- 34.💬 How does an HTML comment end? (a) // (b) --> (c) */ (d) >>
-
35.📝 How many paragraphs does this code make?
<p>Rain today</p>
<h2>The red kite</h2>
<p>My best friend</p> -
36.🔗 Which words do you click on?
<a href="https://example.com">Art corner</a> (a) School news (b) href (c) Art corner (d) https://example.com -
37.🔗 Which words do you click on?
<a href="quiz.html">Take the quiz</a> (a) quiz.html (b) Take the quiz (c) href (d) Play games - 38.Which of these is an opening tag? (a) <h1> (b) </title> (c) </p> (d) </li>
- 39.True or false: a code editor is where we type code. (a) True (b) False
- 40.🌐 Which one turns HTML into a page? (a) a code editor (b) a web browser (c) a web server
Answer key
- the body
- </small>
- 4
- in a new tab
- hosts websites online
- line 1
- False
- sends pages over the net
- True
- an opening tag
- <li>
- line 3
- 1
- 3
- <img>
- to describe the image
- 2
- src
- False
- <a href="about.html">
- 1
- </h1>
- a closing tag
- <!DOCTYPE html>
- line 1
- 3
- No
- numbers
- Visit the site
- 2
- No
- an attribute
- True
- -->
- 2
- Art corner
- Take the quiz
- <h1>
- True
- a web browser
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids