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.True or false: <hr> has a closing tag. (a) False (b) True
-
2.🖼️ How many pixels wide is the picture drawn?
<img src="dog.jpg" alt="A happy dog" width="150"> - 3.🌐 Which one colours code to help us? (a) a web server (b) a code editor (c) a web browser
- 4.True or false: <ul> is an unordered list. (a) True (b) False
- 5.🔗 Which tag makes a clickable link? (a) <p> (b) <a> (c) <link> (d) <img>
-
6.🖼️ How many pixels wide is the picture drawn?
<img src="map.png" alt="Map of India" width="150"> - 7.🔠 How many <h1> headings should a page usually have? (a) 6 (b) 10 (c) 3 (d) 1
- 8.📋 Which list tag is one item of a list? (a) <ol> (b) <ul> (c) <li>
- 9.💬 How does an HTML comment end? (a) */ (b) // (c) >> (d) -->
- 10.True or false: HTML on its own can pick a random number. (a) False (b) True
-
11.📋 Does this list show bullets or numbers?
<ol>
<li>Grapes</li>
<li>Guava</li>
<li>Mango</li>
</ol> (a) numbers (b) bullets - 12.Which of these is true of a web browser? (a) is where we type code (b) sends pages over the net (c) answers page requests (d) opens web pages for us
- 13.💬 How does an HTML comment start? (a) # (b) /* (c) // (d) <!--
- 14.💬 Can anyone read your comments by viewing the page source? (a) No (b) Yes
-
15.📋 What number does the browser show next to “Grapes”?
<ol>
<li>Papaya</li>
<li>Orange</li>
<li>Grapes</li>
</ol> - 16.🔠 Which heading shows the SMALLEST text: <h1>, <h5>, <h3> or <h2>? (a) <h1> (b) <h5> (c) <h3> (d) <h2>
-
17.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>Space Facts</title>
</head>
<body>
<h1>My drawings</h1>
<p>We won by 5 runs.</p>
</body>
</html> (a) We won by 5 runs. (b) Space Facts (c) My drawings (d) index.html - 18.🔗 Which code links to about.html? (a) <a src="about.html"> (b) <a alt="about.html"> (c) <a href="about.html"> (d) <link about.html>
- 19.📄 Where does <meta charset="utf-8"> go: in the head or in the body? (a) in the head (b) in the body
- 20.True or false: <p> goes in the head. (a) False (b) True
- 21.True or false: <br> has a closing tag. (a) False (b) True
-
22.📋 What number does the browser show next to “Mango”?
<ol start="4">
<li>Litchi</li>
<li>Jamun</li>
<li>Mango</li>
</ol> -
23.🔠 How many headings are in this code?
<h1>Our school trip</h1>
<p>My best friend</p>
<h3>Hello, world!</h3> - 24.🔢 In a basic web page file, which comes first: “<body>” or “<head>”? (a) <body> (b) <head>
-
25.💬 How many paragraphs show on the page?
<p>My pets</p>
<p>Fun facts</p>
<p>Rain today</p>
<!-- <p>My best friend</p> --> -
26.💬 How many paragraphs show on the page?
<p>Our school trip</p>
<p>Rain today</p>
<!-- <p>My pets</p> --> -
27.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="map.png" alt="Map of India" width="300"> (a) Map of India (b) width (c) map.png (d) Birthday cake -
28.🖼️ How many pixels wide is the picture drawn?
<img src="fort.jpg" alt="An old fort" width="250"> - 29.🔗 What does target="_blank" do to a link? (a) hides the link (b) opens it in a new tab (c) makes it blank (d) makes it bold
- 30.📝 What does <p> make? (a) a paragraph (b) a link (c) a table (d) a picture
- 31.Which of these is true of a web server? (a) has an address bar (b) answers page requests (c) turns HTML into a page (d) is where we type code
- 32.🌐 Which one sends pages over the net? (a) a web browser (b) a code editor (c) a web server
-
33.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="tiger.jpg" alt="A tiger asleep" width="350"> (a) A tiger asleep (b) width (c) tiger.jpg (d) A red kite - 34.🖼️ Which attribute of <img> sets how wide it is? (a) height (b) width (c) src (d) alt
-
35.🔍 Which line is missing its closing tag?
line 1: <p>Rain today</p>
line 2: <u>I love mangoes.
line 3: <h3>My pets</h3> (a) line 2 (b) line 1 (c) line 3 -
36.📝 On how many lines does the browser show this paragraph?
<p>Birds sing<br>Sky is blue<br>Roses are red<br>Stars shine</p> - 37.🌐 Which one turns HTML into a page? (a) a web server (b) a code editor (c) a web browser
-
38.🔠 How many headings are in this code?
<h1>Cricket is fun.</h1>
<p>I love mangoes.</p>
<h4>Cricket is fun.</h4>
<h4>I love mangoes.</h4> - 39.🔗 Which attribute holds the address of a link? (a) id (b) alt (c) src (d) href
- 40.🔠 Which heading shows the BIGGEST text: <h6>, <h3>, <h2> or <h1>? (a) <h3> (b) <h2> (c) <h6> (d) <h1>
Answer key
- False
- 150
- a code editor
- True
- <a>
- 150
- 1
- <li>
- -->
- False
- numbers
- opens web pages for us
- <!--
- Yes
- 3
- <h5>
- Space Facts
- <a href="about.html">
- in the head
- False
- False
- 6
- 2
- <head>
- 3
- 2
- Map of India
- 250
- opens it in a new tab
- a paragraph
- answers page requests
- a web server
- A tiger asleep
- width
- line 2
- 4
- a web browser
- 3
- href
- <h1>
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids