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 attribute holds the address of a link? (a) href (b) id (c) src (d) alt
- 2.📝 What does <hr> draw? (a) a picture (b) a table (c) a line across the page (d) a link
-
3.📝 On how many lines does the browser show this paragraph?
<p>Stars shine<br>Sky is blue</p> -
4.🔠 How many headings are in this code?
<h1>I love mangoes.</h1>
<h4>Rain today</h4>
<h3>My best friend</h3>
<h4>Our school trip</h4> - 5.🔠 How many heading levels does HTML have? (a) 10 (b) 4 (c) 3 (d) 6
- 6.🏷️ Every HTML tag starts with which sign? (a) < (b) [ (c) { (d) (
- 7.🖼️ Does <img> need a closing tag? (a) Yes (b) No
-
8.🖼️ How many pixels wide is the picture drawn?
<img src="tiger.jpg" alt="A tiger asleep" width="50"> - 9.True or false: <meta charset="utf-8"> goes in the head. (a) False (b) True
-
10.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>My Hobbies</title>
</head>
<body>
<h1>Match report</h1>
<p>Try this poha.</p>
</body>
</html> (a) Try this poha. (b) body (c) My Hobbies (d) Match report -
11.🔗 Which address opens when you click this link?
<a href="https://example.com">Play games</a> (a) https://example.com (b) art.html (c) Play games (d) maths.html - 12.🖼️ Why do we add alt text to an image? (a) to load it faster (b) to describe the image (c) to make it bigger (d) to colour it
- 13.📝 What does <br> do? (a) starts a new line (b) makes text bold (c) makes a list (d) adds a picture
- 14.🔗 Which tag makes a clickable link? (a) <img> (b) <link> (c) <p> (d) <a>
- 15.📝 What does <p> make? (a) a paragraph (b) a table (c) a link (d) a picture
-
16.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="dog.jpg" alt="A happy dog" width="100"> (a) dog.jpg (b) width (c) A happy dog (d) The full moon - 17.🖼️ Which attribute of <img> names the picture file? (a) width (b) height (c) src (d) alt
- 18.Which of these goes in the body? (a) <title> (b) <link rel="stylesheet"> (c) <table> (d) <style>
- 19.Which of these has a closing tag? (a) <img> (b) <meta> (c) <ul> (d) <input>
- 20.True or false: a web browser shows pages from the web. (a) True (b) False
- 21.Which of these is true of a code editor? (a) opens web pages for us (b) hosts websites online (c) shows pages from the web (d) is where we type code
-
22.🔠 How many headings are in this code?
<h1>Good morning!</h1>
<p>My pets</p>
<h2>The red kite</h2>
<h3>Hello, world!</h3>
<h3>My pets</h3> - 23.📋 Which list tag is one item of a list? (a) <li> (b) <ul> (c) <ol>
-
24.🔠 How many headings are in this code?
<h1>I love mangoes.</h1>
<p>Fun facts</p>
<h3>My best friend</h3>
<p>My best friend</p>
<h3>The red kite</h3> - 25.True or false: a code editor shows line numbers. (a) True (b) False
- 26.🔗 What does target="_blank" do to a link? (a) opens it in a new tab (b) makes it bold (c) hides the link (d) makes it blank
- 27.📄 Can HTML on its own keep a high score? (a) No (b) Yes
- 28.🔠 Which tag is the least important heading? (a) <p> (b) <h3> (c) <h1> (d) <h6>
- 29.True or false: in <img>, width sets how wide it is. (a) True (b) False
-
30.💬 How many paragraphs show on the page?
<p>I love mangoes.</p>
<p>Our school trip</p>
<!-- <p>My best friend</p> --> -
31.💬 How many paragraphs show on the page?
<p>Rain today</p>
<p>My pets</p>
<!-- <p>Fun facts</p> --> - 32.🌍 Which program shows a web page to us? (a) a paint program (b) a web browser (c) a music player (d) a calculator
- 33.🔠 Which heading shows the BIGGEST text: <h6>, <h4>, <h5> or <h1>? (a) <h5> (b) <h1> (c) <h6> (d) <h4>
- 34.🏷️ What does a closing tag have that an opening tag does not? (a) a slash / (b) a hash # (c) a dollar $ (d) a dot .
- 35.💬 How does an HTML comment start? (a) /* (b) // (c) <!-- (d) #
-
36.🖼️ Which picture file does the browser load?
<img src="tiger.jpg" alt="A tiger asleep" width="350"> (a) kite.png (b) map.png (c) A tiger asleep (d) tiger.jpg - 37.🔠 Which heading shows the SMALLEST text: <h4>, <h3>, <h5> or <h2>? (a) <h5> (b) <h4> (c) <h3> (d) <h2>
- 38.True or false: <ol> lists things in any order. (a) True (b) False
- 39.📝 Does <ul> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
- 40.True or false: <style> goes in the body. (a) True (b) False
Answer key
- href
- a line across the page
- 2
- 4
- 6
- <
- No
- 50
- True
- Match report
- https://example.com
- to describe the image
- starts a new line
- <a>
- a paragraph
- A happy dog
- src
- <table>
- <ul>
- True
- is where we type code
- 4
- <li>
- 3
- True
- opens it in a new tab
- No
- <h6>
- True
- 2
- 2
- a web browser
- <h1>
- a slash /
- <!--
- tiger.jpg
- <h5>
- False
- has a closing tag
- False
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids