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 head (b) the doctype (c) the body (d) the title
- 2.🔍 Which is the odd one out? (a) has an address bar (b) shows line numbers (c) shows pages from the web (d) opens web pages for us
- 3.Which of these is a closing tag? (a) <h1> (b) </p> (c) <title> (d) <b>
-
4.💬 How many paragraphs show on the page?
<p>Hello, world!</p>
<p>Cricket is fun.</p>
<!-- <p>Good morning!</p> -->
<!-- <p>Rain today</p> -->
<p>My pets</p> -
5.🔍 One closing tag is missing. Which one?
<small>Cricket is fun.
<h1>Our school trip</h1>
<u>Rain today</u> (a) </u> (b) </h2> (c) </small> (d) </h1> - 6.🔗 What does target="_blank" do to a link? (a) hides the link (b) opens it in a new tab (c) makes it bold (d) makes it blank
-
7.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>My Hobbies</title>
</head>
<body>
<h1>Easy snacks</h1>
<p>Thanks for visiting.</p>
</body>
</html> (a) Thanks for visiting. (b) My Hobbies (c) body (d) Easy snacks - 8.🧩 An opening tag + content + a closing tag together make an ___. (a) element (b) editor (c) attribute (d) address
-
9.📝 On how many lines does the browser show this paragraph?
<p>Roses are red<br>Rivers flow<br>Kites fly high<br>Birds sing</p> - 10.True or false: a web browser is where we type code. (a) False (b) True
- 11.🔠 Which heading shows the BIGGEST text: <h3>, <h1>, <h4> or <h5>? (a) <h1> (b) <h4> (c) <h5> (d) <h3>
- 12.Which of these is true of a web browser? (a) is where we type code (b) opens web pages for us (c) saves our .html files (d) answers page requests
-
13.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="moon.png" alt="The full moon" width="250"> (a) Our school bus (b) moon.png (c) The full moon (d) width - 14.True or false: a code editor shows pages from the web. (a) False (b) True
- 15.Which of these goes in the body? (a) <link rel="stylesheet"> (b) <meta charset="utf-8"> (c) <title> (d) <img>
-
16.🔍 One closing tag is missing. Which one?
<h3>My pets</h3>
<h2>Fun facts</h2>
<b>Cricket is fun. (a) </h3> (b) </h2> (c) </p> (d) </b> - 17.🏷️ Every HTML tag starts with which sign? (a) { (b) ( (c) [ (d) <
-
18.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="bus.jpg" alt="Our school bus" width="100"> (a) Our school bus (b) An old fort (c) bus.jpg (d) width -
19.🔠 How many headings are in this code?
<h1>Hello, world!</h1>
<p>The red kite</p>
<p>My best friend</p>
<h2>Hello, world!</h2>
<p>Hello, world!</p> - 20.Which of these is an empty tag? (a) <b> (b) <title> (c) <ul> (d) <meta>
- 21.📋 Which list shows the steps of a recipe best? (a) <ul> (b) <br> (c) <ol> (d) <hr>
- 22.🔠 Which heading shows the SMALLEST text: <h4>, <h6>, <h2> or <h1>? (a) <h6> (b) <h2> (c) <h4> (d) <h1>
- 23.🔍 Which is the odd one out? (a) colours code to help us (b) shows line numbers (c) shows pages from the web (d) is where we type code
- 24.🔗 Which attribute holds the address of a link? (a) src (b) alt (c) id (d) href
- 25.💬 How does an HTML comment start? (a) # (b) <!-- (c) // (d) /*
- 26.Which of these is an empty tag? (a) <title> (b) <b> (c) <h1> (d) <img>
- 27.True or false: a web server stores a website’s files. (a) True (b) False
- 28.🏷️ Which is the closing tag for <em>? (a) <em/> (b) <em> (c) </em> (d) <\em>
-
29.💬 Which text will NOT show on the page?
<p>I love mangoes.</p>
<!-- <p>Rain today</p> -->
<p>Good morning!</p> (a) Rain today (b) I love mangoes. (c) Good morning! - 30.📄 Where does <h1> go: in the head or in the body? (a) in the body (b) in the head
-
31.🔍 One closing tag is missing. Which one?
<b>My best friend
<h3>The red kite</h3>
<u>I love mangoes.</u> (a) </em> (b) </u> (c) </b> (d) </h3> -
32.💬 Which text will NOT show on the page?
<p>Our school trip</p>
<!-- <p>Rain today</p> -->
<p>Fun facts</p>
<p>Good morning!</p> (a) Rain today (b) Our school trip (c) Good morning! (d) Fun facts - 33.🖼️ Which attribute of <img> shows if the image fails? (a) src (b) width (c) height (d) alt
-
34.📝 How many paragraphs does this code make?
<p>Hello, world!</p>
<h2>Good morning!</h2>
<h2>Fun facts</h2>
<p>The red kite</p>
<p>Rain today</p> - 35.🌐 Which one hosts websites online? (a) a code editor (b) a web server (c) a web browser
-
36.🔠 How many headings are in this code?
<h1>Cricket is fun.</h1>
<h2>My pets</h2>
<p>Good morning!</p> -
37.💬 Which text will NOT show on the page?
<p>Our school trip</p>
<!-- <p>Good morning!</p> -->
<p>My best friend</p>
<p>The red kite</p> (a) Our school trip (b) My best friend (c) The red kite (d) Good morning! - 38.🖼️ Which attribute of <img> sets how wide it is? (a) height (b) alt (c) src (d) width
- 39.🔡 Are HTML tag names usually written in small letters? (a) Yes (b) No
- 40.🌐 Which one answers page requests? (a) a code editor (b) a web browser (c) a web server
Answer key
- the body
- shows line numbers
- </p>
- 3
- </small>
- opens it in a new tab
- Easy snacks
- element
- 4
- False
- <h1>
- opens web pages for us
- The full moon
- False
- <img>
- </b>
- <
- Our school bus
- 2
- <meta>
- <ol>
- <h6>
- shows pages from the web
- href
- <!--
- <img>
- True
- </em>
- Rain today
- in the body
- </b>
- Rain today
- alt
- 3
- a web server
- 2
- Good morning!
- width
- Yes
- a web server
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids