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) opens it in a new tab (b) hides the link (c) makes it bold (d) makes it blank
- 2.Which of these is true of a code editor? (a) shows pages from the web (b) sends pages over the net (c) hosts websites online (d) is where we type code
-
3.🔠 How many headings are in this code?
<h1>Hello, world!</h1>
<h3>I love mangoes.</h3>
<p>Our school trip</p>
<h3>My pets</h3>
<h4>Hello, world!</h4> - 4.🖼️ Which attribute of <img> describes the picture? (a) src (b) height (c) width (d) alt
- 5.📄 What is the first line of an HTML5 page? (a) <!DOCTYPE html> (b) <head> (c) <html> (d) <body>
-
6.📝 On how many lines does the browser show this paragraph?
<p>Stars shine<br>Roses are red<br>Kites fly high<br>Birds sing</p> -
7.💬 Which text will NOT show on the page?
<!-- <p>The red kite</p> -->
<p>My best friend</p>
<p>I love mangoes.</p> (a) The red kite (b) I love mangoes. (c) My best friend - 8.📄 Where does <ul> go: in the head or in the body? (a) in the body (b) in the head
- 9.Which of these is a closing tag? (a) </b> (b) <title> (c) <li> (d) <b>
-
10.🔍 Which line is missing its closing tag?
line 1: <i>I love mangoes.</i>
line 2: <u>Our school trip</u>
line 3: <strong>Hello, world! (a) line 2 (b) line 3 (c) line 1 -
11.📋 How many items does this list show?
<ol>
<li>Banana</li>
<li>Papaya</li>
</ol> - 12.True or false: <a> goes in the body. (a) False (b) True
-
13.🔗 Which address opens when you click this link?
<a href="about.html">About us</a> (a) https://example.com (b) contact.html (c) About us (d) about.html - 14.🏷️ Is <h1> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
-
15.🔗 Which words do you click on?
<a href="contact.html">Contact us</a> (a) Visit the site (b) Contact us (c) href (d) contact.html - 16.Which of these is true of a web browser? (a) shows line numbers (b) shows pages from the web (c) is where we type code (d) sends pages over the net
- 17.🔠 Which heading shows the BIGGEST text: <h5>, <h6>, <h3> or <h4>? (a) <h3> (b) <h6> (c) <h5> (d) <h4>
-
18.💬 How many paragraphs show on the page?
<p>The red kite</p>
<p>Rain today</p>
<!-- <p>Hello, world!</p> -->
<p>Cricket is fun.</p> - 19.🔍 Which is the odd one out? (a) hosts websites online (b) answers page requests (c) sends pages over the net (d) opens web pages for us
-
20.🖼️ Which picture file does the browser load?
<img src="tiger.jpg" alt="A tiger asleep" width="400"> (a) kite.png (b) A tiger asleep (c) tiger.jpg (d) map.png - 21.🏷️ Is </title> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
-
22.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Space Facts</title>
</head>
<body>
<h1>Welcome!</h1>
<p>We won by 5 runs.</p>
</body>
</html> (a) We won by 5 runs. (b) Space Facts (c) body (d) Welcome! - 23.Which of these goes in the head? (a) <h1> (b) <ul> (c) <img> (d) <meta charset="utf-8">
-
24.🔗 Where does this link open?
<a href="quiz.html" target="_blank">Visit the site</a> (a) in a new tab (b) in the same tab - 25.📝 What does <hr> draw? (a) a table (b) a link (c) a picture (d) a line across the page
- 26.🔍 Which is the odd one out? (a) opens web pages for us (b) has an address bar (c) turns HTML into a page (d) stores a website’s files
-
27.💬 How many paragraphs show on the page?
<p>Cricket is fun.</p>
<!-- <p>Our school trip</p> -->
<!-- <p>I love mangoes.</p> --> - 28.Which of these is a closing tag? (a) <h1> (b) <p> (c) <li> (d) </title>
-
29.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Riya’s Recipes</title>
</head>
<body>
<h1>Easy snacks</h1>
<p>I like to read.</p>
</body>
</html> (a) Riya’s Recipes (b) Easy snacks (c) I like to read. (d) body - 30.True or false: <a> goes in the head. (a) False (b) True
- 31.📋 Which list tag shows bullet points? (a) <ol> (b) <ul> (c) <li>
-
32.📋 Does this list show bullets or numbers?
<ol>
<li>Papaya</li>
<li>Jamun</li>
<li>Banana</li>
</ol> (a) bullets (b) numbers -
33.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="bus.jpg" alt="Our school bus" width="150"> (a) bus.jpg (b) width (c) Our school bus (d) An old fort -
34.🖼️ Which picture file does the browser load?
<img src="cake.jpg" alt="Birthday cake" width="250"> (a) moon.png (b) cake.jpg (c) dog.jpg (d) Birthday cake - 35.📋 Which list tag shows 1, 2, 3 numbers? (a) <ol> (b) <ul> (c) <li>
- 36.📋 Which tag goes around each item of a list? (a) <ol> (b) <ul> (c) <p> (d) <li>
- 37.📝 What does <br> do? (a) starts a new line (b) makes text bold (c) makes a list (d) adds a picture
- 38.📋 Which list shows the steps of a recipe best? (a) <br> (b) <ol> (c) <hr> (d) <ul>
- 39.🔠 How many <h1> headings should a page usually have? (a) 3 (b) 6 (c) 10 (d) 1
- 40.💬 How does an HTML comment start? (a) /* (b) <!-- (c) // (d) #
Answer key
- opens it in a new tab
- is where we type code
- 4
- alt
- <!DOCTYPE html>
- 4
- The red kite
- in the body
- </b>
- line 3
- 2
- True
- about.html
- an opening tag
- Contact us
- shows pages from the web
- <h3>
- 3
- opens web pages for us
- tiger.jpg
- a closing tag
- Welcome!
- <meta charset="utf-8">
- in a new tab
- a line across the page
- stores a website’s files
- 1
- </title>
- Easy snacks
- False
- <ul>
- numbers
- Our school bus
- cake.jpg
- <ol>
- <li>
- starts a new line
- <ol>
- 1
- <!--
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids