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.🧩 An opening tag + content + a closing tag together make an ___. (a) address (b) element (c) attribute (d) editor
- 2.📄 Where does <style> go: in the head or in the body? (a) in the body (b) in the head
-
3.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="dog.jpg" alt="A happy dog" width="350"> (a) The full moon (b) dog.jpg (c) A happy dog (d) width -
4.🖼️ Which picture file does the browser load?
<img src="cake.jpg" alt="Birthday cake" width="300"> (a) cake.jpg (b) Birthday cake (c) moon.png (d) dog.jpg -
5.📝 On how many lines does the browser show this paragraph?
<p>Sky is blue<br>Stars shine<br>Rivers flow<br>Birds sing<br>Kites fly high</p> -
6.🔠 How many headings are in this code?
<h1>I love mangoes.</h1>
<h2>I love mangoes.</h2>
<h4>Good morning!</h4>
<h3>The red kite</h3> - 7.🔢 In a basic web page file, which comes first: “<html>” or “<!DOCTYPE html>”? (a) <html> (b) <!DOCTYPE html>
-
8.🔗 Where does this link open?
<a href="news.html">Contact us</a> (a) in the same tab (b) in a new tab - 9.💬 Can anyone read your comments by viewing the page source? (a) Yes (b) No
- 10.Which of these is true of a web server? (a) has an address bar (b) stores a website’s files (c) shows line numbers (d) shows pages from the web
- 11.True or false: <p> goes in the head. (a) True (b) False
- 12.🖼️ Which tag puts a picture on a page? (a) <a> (b) <pic> (c) <p> (d) <img>
- 13.📝 What does <br> do? (a) makes text bold (b) starts a new line (c) makes a list (d) adds a picture
-
14.💬 How many paragraphs show on the page?
<!-- <p>Hello, world!</p> -->
<p>The red kite</p>
<!-- <p>I love mangoes.</p> -->
<!-- <p>Our school trip</p> --> - 15.🔠 Which heading shows the BIGGEST text: <h2>, <h5>, <h1> or <h4>? (a) <h4> (b) <h1> (c) <h2> (d) <h5>
- 16.🔠 Which heading shows the BIGGEST text: <h6>, <h2>, <h3> or <h1>? (a) <h3> (b) <h6> (c) <h2> (d) <h1>
-
17.🔗 Which address opens when you click this link?
<a href="quiz.html">School news</a> (a) games.html (b) about.html (c) School news (d) quiz.html -
18.🔍 One closing tag is missing. Which one?
<i>Our school trip</i>
<u>The red kite</u>
<p>Cricket is fun. (a) </u> (b) </i> (c) </strong> (d) </p> - 19.True or false: in <img>, width shows if the image fails. (a) True (b) False
- 20.Which of these goes in the body? (a) <style> (b) <h1> (c) <link rel="stylesheet"> (d) <meta charset="utf-8">
-
21.🔍 One closing tag is missing. Which one?
<em>Our school trip</em>
<p>Cricket is fun.
<h1>I love mangoes.</h1> (a) </p> (b) </u> (c) </em> (d) </h1> -
22.💬 Which text will NOT show on the page?
<!-- <p>I love mangoes.</p> -->
<p>Fun facts</p>
<p>Hello, world!</p>
<p>My pets</p> (a) My pets (b) Fun facts (c) I love mangoes. (d) Hello, world! - 23.True or false: a code editor is where we type code. (a) True (b) False
- 24.🔍 Which is the odd one out? (a) sends pages over the net (b) answers page requests (c) stores a website’s files (d) is where we type code
- 25.Which of these has a closing tag? (a) <br> (b) <li> (c) <hr> (d) <input>
- 26.🔡 Are HTML tag names usually written in small letters? (a) Yes (b) No
- 27.🏷️ Which is the closing tag for <h3>? (a) <h3> (b) <\h3> (c) </h3> (d) <h3/>
- 28.🖼️ Which attribute of <img> tells which image to load? (a) width (b) src (c) alt (d) height
- 29.🔠 Which tag is used for the main title on a page? (a) <p> (b) <h1> (c) <h6> (d) <br>
- 30.📋 Which tag goes around each item of a list? (a) <li> (b) <p> (c) <ul> (d) <ol>
- 31.💬 Why do coders write comments? (a) to show pictures (b) to leave notes (c) to add colour (d) to make links
-
32.🔗 Which words do you click on?
<a href="games.html">Art corner</a> (a) games.html (b) Art corner (c) href (d) School news - 33.🔠 Which heading shows the BIGGEST text: <h6>, <h3>, <h1> or <h4>? (a) <h1> (b) <h4> (c) <h6> (d) <h3>
- 34.Which of these is an opening tag? (a) </p> (b) </li> (c) </b> (d) <body>
- 35.🖼️ Which attribute of <img> is read by screen readers? (a) src (b) width (c) height (d) alt
-
36.🔍 Which line is missing its closing tag?
line 1: <strong>The red kite</strong>
line 2: <h2>My best friend</h2>
line 3: <u>Rain today (a) line 1 (b) line 3 (c) line 2 - 37.🔗 What does target="_blank" do to a link? (a) makes it blank (b) hides the link (c) makes it bold (d) opens it in a new tab
- 38.True or false: <meta> is an empty tag. (a) False (b) True
- 39.🌐 Which one shows pages from the web? (a) a web server (b) a code editor (c) a web browser
- 40.Which of these is an opening tag? (a) </li> (b) </b> (c) <p> (d) </h1>
Answer key
- element
- in the head
- A happy dog
- cake.jpg
- 5
- 4
- <!DOCTYPE html>
- in the same tab
- Yes
- stores a website’s files
- False
- <img>
- starts a new line
- 1
- <h1>
- <h1>
- quiz.html
- </p>
- False
- <h1>
- </p>
- I love mangoes.
- True
- is where we type code
- <li>
- Yes
- </h3>
- src
- <h1>
- <li>
- to leave notes
- Art corner
- <h1>
- <body>
- alt
- line 3
- opens it in a new tab
- True
- a web browser
- <p>
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids