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.🔗 What does target="_blank" do to a link? (a) makes it blank (b) opens it in a new tab (c) hides the link (d) makes it bold
- 2.📄 Which part holds everything you see on the page? (a) the head (b) the body (c) the doctype (d) the title
-
3.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="tiger.jpg" alt="A tiger asleep" width="250"> (a) A red kite (b) A tiger asleep (c) tiger.jpg (d) width - 4.🔡 Are HTML tag names usually written in small letters? (a) Yes (b) No
-
5.💬 Which text will NOT show on the page?
<!-- <p>My best friend</p> -->
<p>Good morning!</p>
<p>Cricket is fun.</p>
<p>Our school trip</p> (a) My best friend (b) Our school trip (c) Cricket is fun. (d) Good morning! - 6.🔠 Which heading shows the SMALLEST text: <h6>, <h4>, <h2> or <h3>? (a) <h6> (b) <h4> (c) <h3> (d) <h2>
- 7.🖼️ Does <img> need a closing tag? (a) Yes (b) No
-
8.💬 Which text will NOT show on the page?
<p>Good morning!</p>
<!-- <p>Cricket is fun.</p> -->
<p>Rain today</p> (a) Good morning! (b) Cricket is fun. (c) Rain today - 9.Which of these is an opening tag? (a) <p> (b) </title> (c) </b> (d) </p>
- 10.🔢 In a basic web page file, which comes first: “<head>” or “<!DOCTYPE html>”? (a) <head> (b) <!DOCTYPE html>
-
11.🔠 How many headings are in this code?
<h1>Our school trip</h1>
<h4>The red kite</h4>
<h2>Our school trip</h2>
<h3>Our school trip</h3>
<p>Fun facts</p> -
12.📋 What number does the browser show next to “Papaya”?
<ol start="9">
<li>Grapes</li>
<li>Banana</li>
<li>Guava</li>
<li>Papaya</li>
<li>Orange</li>
</ol> - 13.🔤 In “HTML”, what does the L stand for? (a) Laptop (b) Link (c) Language (d) Line
- 14.🔗 Which tag makes a clickable link? (a) <link> (b) <p> (c) <img> (d) <a>
- 15.🔗 Which code links to about.html? (a) <a src="about.html"> (b) <a href="about.html"> (c) <link about.html> (d) <a alt="about.html">
- 16.🖼️ Which attribute of <img> names the picture file? (a) width (b) alt (c) src (d) height
- 17.True or false: <table> goes in the head. (a) False (b) True
-
18.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Space Facts</title>
</head>
<body>
<h1>Planets</h1>
<p>We won by 5 runs.</p>
</body>
</html> (a) Planets (b) Space Facts (c) body (d) We won by 5 runs. - 19.🏷️ Which is the closing tag for <h2>? (a) </h2> (b) <h2/> (c) <\h2> (d) <h2>
-
20.📋 How many items does this list show?
<ol>
<li>Grapes</li>
<li>Papaya</li>
<li>Jamun</li>
<li>Mango</li>
<li>Guava</li>
<li>Banana</li>
</ol> - 21.Which of these is true of a code editor? (a) turns HTML into a page (b) shows pages from the web (c) sends pages over the net (d) saves our .html files
- 22.True or false: a web browser shows pages from the web. (a) False (b) True
-
23.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="moon.png" alt="The full moon" width="50"> (a) Our school bus (b) width (c) moon.png (d) The full moon -
24.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="tiger.jpg" alt="A tiger asleep" width="150"> (a) tiger.jpg (b) A red kite (c) width (d) A tiger asleep -
25.💬 How many paragraphs show on the page?
<!-- <p>Hello, world!</p> -->
<p>Our school trip</p>
<p>Cricket is fun.</p>
<p>Rain today</p>
<p>The red kite</p> - 26.🖼️ Which tag puts a picture on a page? (a) <p> (b) <pic> (c) <img> (d) <a>
- 27.🔠 Which heading shows the SMALLEST text: <h2>, <h5>, <h6> or <h4>? (a) <h5> (b) <h2> (c) <h4> (d) <h6>
-
28.🔍 One closing tag is missing. Which one?
<h2>The red kite</h2>
<h1>My pets
<em>My best friend</em> (a) </h2> (b) </i> (c) </h1> (d) </em> - 29.True or false: <p> is an empty tag. (a) False (b) True
-
30.🔗 Where does this link open?
<a href="maths.html">Contact us</a> (a) in the same tab (b) in a new tab -
31.💬 Which text will NOT show on the page?
<!-- <p>Fun facts</p> -->
<p>My pets</p>
<p>Hello, world!</p> (a) My pets (b) Fun facts (c) Hello, world! - 32.🖼️ Why do we add alt text to an image? (a) to colour it (b) to load it faster (c) to make it bigger (d) to describe the image
- 33.📝 You type 5 spaces between two words in a <p>. How does the browser show them? (a) as one space (b) as a dot (c) as a new line (d) as 5 spaces
- 34.📄 Where does <meta charset="utf-8"> go: in the head or in the body? (a) in the head (b) in the body
- 35.📝 What does <hr> draw? (a) a table (b) a picture (c) a link (d) a line across the page
-
36.📋 How many items does this list show?
<ul>
<li>Mango</li>
<li>Papaya</li>
<li>Jamun</li>
<li>Guava</li>
<li>Orange</li>
</ul> -
37.🖼️ Which picture file does the browser load?
<img src="tiger.jpg" alt="A tiger asleep" width="400"> (a) A tiger asleep (b) map.png (c) kite.png (d) tiger.jpg - 38.True or false: <img> has a closing tag. (a) True (b) False
-
39.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="dog.jpg" alt="A happy dog" width="50"> (a) width (b) The full moon (c) dog.jpg (d) A happy dog - 40.Which of these has a closing tag? (a) <input> (b) <hr> (c) <br> (d) <p>
Answer key
- opens it in a new tab
- the body
- A tiger asleep
- Yes
- My best friend
- <h6>
- No
- Cricket is fun.
- <p>
- <!DOCTYPE html>
- 4
- 12
- Language
- <a>
- <a href="about.html">
- src
- False
- Planets
- </h2>
- 6
- saves our .html files
- True
- The full moon
- A tiger asleep
- 4
- <img>
- <h6>
- </h1>
- False
- in the same tab
- Fun facts
- to describe the image
- as one space
- in the head
- a line across the page
- 5
- tiger.jpg
- False
- A happy dog
- <p>
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids