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: a web browser sends pages over the net. (a) False (b) True
-
2.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="dog.jpg" alt="A happy dog" width="150"> (a) dog.jpg (b) The full moon (c) width (d) A happy dog - 3.True or false: a web server is where we type code. (a) True (b) False
-
4.🔗 Which words do you click on?
<a href="news.html">Play games</a> (a) href (b) news.html (c) About us (d) Play games - 5.True or false: a code editor shows pages from the web. (a) True (b) False
-
6.🔠 How many headings are in this code?
<h1>Rain today</h1>
<h4>My best friend</h4>
<p>Good morning!</p> -
7.🔠 How many headings are in this code?
<h1>My best friend</h1>
<p>I love mangoes.</p>
<p>Hello, world!</p>
<p>The red kite</p> - 8.🔢 In a basic web page file, which comes first: “<body>” or “<!DOCTYPE html>”? (a) <!DOCTYPE html> (b) <body>
- 9.True or false: <title> has a closing tag. (a) True (b) False
- 10.📄 Can HTML on its own add pictures to a page? (a) No (b) Yes
-
11.🖼️ Which picture file does the browser load?
<img src="kite.png" alt="A red kite" width="400"> (a) A red kite (b) cake.jpg (c) kite.png (d) map.png -
12.🔗 Where does this link open?
<a href="games.html">Visit the site</a> (a) in a new tab (b) in the same tab -
13.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="fort.jpg" alt="An old fort" width="200"> (a) A tiger asleep (b) width (c) fort.jpg (d) An old fort - 14.🏷️ Which is the closing tag for <u>? (a) <\u> (b) <u> (c) <u/> (d) </u>
- 15.True or false: HTML on its own can count button clicks. (a) False (b) True
- 16.🖼️ Which attribute of <img> tells which image to load? (a) height (b) width (c) alt (d) src
- 17.🏷️ What does a closing tag have that an opening tag does not? (a) a hash # (b) a dollar $ (c) a slash / (d) a dot .
- 18.🖼️ Which tag puts a picture on a page? (a) <a> (b) <p> (c) <pic> (d) <img>
- 19.Which of these is an empty tag? (a) <p> (b) <b> (c) <h1> (d) <img>
- 20.🌐 Which one shows pages from the web? (a) a code editor (b) a web browser (c) a web server
- 21.True or false: a web server hosts websites online. (a) True (b) False
-
22.📋 What number does the browser show next to “Mango”?
<ol>
<li>Banana</li>
<li>Mango</li>
<li>Litchi</li>
<li>Jamun</li>
</ol> -
23.💬 Which text will NOT show on the page?
<!-- <p>I love mangoes.</p> -->
<p>My pets</p>
<p>Cricket is fun.</p> (a) I love mangoes. (b) My pets (c) Cricket is fun. - 24.📄 Where does <a> go: in the head or in the body? (a) in the head (b) in the body
-
25.📋 How many items does this list show?
<ol>
<li>Grapes</li>
<li>Mango</li>
<li>Jamun</li>
</ol> -
26.🖼️ Which picture file does the browser load?
<img src="dog.jpg" alt="A happy dog" width="50"> (a) dog.jpg (b) moon.png (c) bus.jpg (d) A happy dog - 27.🔍 Which is the odd one out? (a) saves our .html files (b) turns HTML into a page (c) opens web pages for us (d) shows pages from the web
-
28.💬 How many paragraphs show on the page?
<!-- <p>Our school trip</p> -->
<!-- <p>My best friend</p> -->
<!-- <p>Cricket is fun.</p> -->
<p>Hello, world!</p>
<!-- <p>The red kite</p> --> - 29.🔍 Which is the odd one out? (a) sends pages over the net (b) answers page requests (c) is where we type code (d) hosts websites online
- 30.Which of these is an opening tag? (a) </p> (b) <li> (c) </li> (d) </title>
- 31.🔠 Which heading shows the SMALLEST text: <h2>, <h3>, <h1> or <h4>? (a) <h2> (b) <h1> (c) <h3> (d) <h4>
- 32.📝 Does <b> have a closing tag, or is it an empty tag? (a) has a closing tag (b) an empty tag
-
33.📝 How many paragraphs does this code make?
<p>Rain today</p>
<p>The red kite</p>
<p>My pets</p> - 34.🖼️ Does <img> need a closing tag? (a) No (b) Yes
-
35.💬 Which text will NOT show on the page?
<p>My best friend</p>
<!-- <p>Cricket is fun.</p> -->
<p>My pets</p>
<p>Hello, world!</p> (a) Cricket is fun. (b) My pets (c) My best friend (d) Hello, world! -
36.📝 On how many lines does the browser show this paragraph?
<p>Stars shine<br>Rivers flow</p> -
37.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>My Hobbies</title>
</head>
<body>
<h1>Easy snacks</h1>
<p>Mars is red.</p>
</body>
</html> (a) Mars is red. (b) index.html (c) My Hobbies (d) Easy snacks -
38.💬 How many paragraphs show on the page?
<p>My pets</p>
<!-- <p>Our school trip</p> -->
<!-- <p>Fun facts</p> -->
<!-- <p>Rain today</p> -->
<!-- <p>I love mangoes.</p> --> -
39.🔍 One closing tag is missing. Which one?
<em>Hello, world!
<u>Fun facts</u>
<h2>The red kite</h2> (a) </em> (b) </h2> (c) </strong> (d) </u> - 40.🏷️ Is <p> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
Answer key
- False
- A happy dog
- False
- Play games
- False
- 2
- 1
- <!DOCTYPE html>
- True
- Yes
- kite.png
- in the same tab
- An old fort
- </u>
- False
- src
- a slash /
- <img>
- <img>
- a web browser
- True
- 2
- I love mangoes.
- in the body
- 3
- dog.jpg
- saves our .html files
- 1
- is where we type code
- <li>
- <h4>
- has a closing tag
- 3
- No
- Cricket is fun.
- 2
- My Hobbies
- 1
- </em>
- an opening tag
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids