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.🔢 In a basic web page file, which comes FIRST? (a) <!DOCTYPE html> (b) <html> (c) <body> (d) <head>
-
2.💬 Which text will NOT show on the page?
<!-- <p>My best friend</p> -->
<p>I love mangoes.</p>
<p>Fun facts</p> (a) My best friend (b) I love mangoes. (c) Fun facts - 3.🌍 Which program shows a web page to us? (a) a calculator (b) a web browser (c) a music player (d) a paint program
- 4.🏷️ Which is the closing tag for <h3>? (a) <h3/> (b) </h3> (c) <\h3> (d) <h3>
- 5.🔍 Which is the odd one out? (a) opens web pages for us (b) turns HTML into a page (c) hosts websites online (d) shows pages from the web
- 6.💬 Can anyone read your comments by viewing the page source? (a) No (b) Yes
- 7.🔠 Are headings shown in bold by default? (a) Yes (b) No
- 8.True or false: in <img>, src describes the picture. (a) True (b) False
-
9.🔗 Which address opens when you click this link?
<a href="news.html">Maths fun</a> (a) quiz.html (b) Maths fun (c) games.html (d) news.html - 10.💬 Why do coders write comments? (a) to show pictures (b) to make links (c) to leave notes (d) to add colour
-
11.🔗 Which address opens when you click this link?
<a href="maths.html">Art corner</a> (a) Art corner (b) art.html (c) news.html (d) maths.html - 12.Which of these is an opening tag? (a) </p> (b) <li> (c) </h1> (d) </title>
- 13.📋 Which list tag is an unordered list? (a) <ul> (b) <ol> (c) <li>
-
14.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>My Hobbies</title>
</head>
<body>
<h1>Welcome!</h1>
<p>Here is my best one.</p>
</body>
</html> (a) Here is my best one. (b) Welcome! (c) My Hobbies (d) body - 15.True or false: in <img>, alt shows if the image fails. (a) False (b) True
- 16.📄 Where does <ul> go: in the head or in the body? (a) in the body (b) in the head
-
17.🔍 Which line is missing its closing tag?
line 1: <h2>Hello, world!</h2>
line 2: <h3>My best friend
line 3: <b>My pets</b> (a) line 1 (b) line 2 (c) line 3 -
18.📋 What number does the browser show next to “Grapes”?
<ol start="3">
<li>Papaya</li>
<li>Orange</li>
<li>Mango</li>
<li>Grapes</li>
<li>Guava</li>
<li>Jamun</li>
</ol> - 19.Which of these has a closing tag? (a) <img> (b) <b> (c) <br> (d) <hr>
-
20.💬 Which text will NOT show on the page?
<!-- <p>My pets</p> -->
<p>Cricket is fun.</p>
<p>Good morning!</p>
<p>The red kite</p> (a) The red kite (b) Cricket is fun. (c) My pets (d) Good morning! - 21.Which of these is true of a web server? (a) hosts websites online (b) colours code to help us (c) is where we type code (d) has an address bar
- 22.Which of these has a closing tag? (a) <br> (b) <hr> (c) <img> (d) <li>
-
23.🔠 How many headings are in this code?
<h1>Good morning!</h1>
<h2>I love mangoes.</h2>
<h4>My pets</h4>
<p>I love mangoes.</p>
<p>My best friend</p> - 24.Which of these is an empty tag? (a) <li> (b) <h1> (c) <ul> (d) <br>
- 25.🏷️ Is <title> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
- 26.🏷️ Which is the closing tag for <em>? (a) <em/> (b) <em> (c) </em> (d) <\em>
- 27.🔗 Which attribute holds the address of a link? (a) href (b) id (c) src (d) alt
- 28.🔠 Which heading shows the SMALLEST text: <h4>, <h2>, <h1> or <h6>? (a) <h2> (b) <h6> (c) <h4> (d) <h1>
- 29.🖼️ Why do we add alt text to an image? (a) to load it faster (b) to describe the image (c) to make it bigger (d) to colour it
- 30.📄 Where does <img> go: in the head or in the body? (a) in the head (b) in the body
-
31.🔠 How many headings are in this code?
<h1>Our school trip</h1>
<p>Our school trip</p>
<p>My pets</p> - 32.🔗 Which code links to about.html? (a) <a href="about.html"> (b) <a alt="about.html"> (c) <link about.html> (d) <a src="about.html">
-
33.📋 Does this list show bullets or numbers?
<ol>
<li>Banana</li>
<li>Litchi</li>
</ol> (a) bullets (b) numbers - 34.True or false: <li> goes inside ul or ol. (a) True (b) False
- 35.🌐 Which one saves our .html files? (a) a web browser (b) a web server (c) a code editor
- 36.Which of these goes in the head? (a) <table> (b) <a> (c) <p> (d) <title>
- 37.True or false: in <img>, width is read by screen readers. (a) False (b) True
- 38.🔍 Which is the odd one out? (a) stores a website’s files (b) saves our .html files (c) hosts websites online (d) sends pages over the net
- 39.📋 Which list tag shows 1, 2, 3 numbers? (a) <ol> (b) <ul> (c) <li>
-
40.💬 How many paragraphs show on the page?
<!-- <p>My pets</p> -->
<p>I love mangoes.</p>
<p>Good morning!</p>
Answer key
- <!DOCTYPE html>
- My best friend
- a web browser
- </h3>
- hosts websites online
- Yes
- Yes
- False
- news.html
- to leave notes
- maths.html
- <li>
- <ul>
- Welcome!
- True
- in the body
- line 2
- 6
- <b>
- My pets
- hosts websites online
- <li>
- 3
- <br>
- an opening tag
- </em>
- href
- <h6>
- to describe the image
- in the body
- 1
- <a href="about.html">
- numbers
- True
- a code editor
- <title>
- False
- saves our .html files
- <ol>
- 2
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids