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.📝 On how many lines does the browser show this paragraph?
<p>Rivers flow<br>Birds sing<br>Stars shine</p> -
2.🔗 Where does this link open?
<a href="maths.html" target="_blank">About us</a> (a) in the same tab (b) in a new tab - 3.🔢 In a basic web page file, which comes LAST? (a) <html> (b) <!DOCTYPE html> (c) <body> (d) </html>
- 4.🏷️ Is </li> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
- 5.📄 Where does <a> go: in the head or in the body? (a) in the body (b) in the head
-
6.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Art Gallery</title>
</head>
<body>
<h1>Planets</h1>
<p>We won by 5 runs.</p>
</body>
</html> (a) Art Gallery (b) We won by 5 runs. (c) body (d) Planets - 7.🔠 Which heading shows the SMALLEST text: <h2>, <h1>, <h3> or <h4>? (a) <h3> (b) <h4> (c) <h1> (d) <h2>
- 8.🔗 What does HyperText mean? (a) very big text (b) text with links (c) text in colour (d) secret text
-
9.📝 On how many lines does the browser show this paragraph?
<p>Rivers flow<br>Birds sing<br>Kites fly high<br>Stars shine<br>Sky is blue</p> - 10.🖼️ Which attribute of <img> sets how tall it is? (a) height (b) width (c) src (d) alt
- 11.Which of these is true of a web server? (a) opens web pages for us (b) saves our .html files (c) shows pages from the web (d) answers page requests
-
12.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="moon.png" alt="The full moon" width="100"> (a) moon.png (b) Our school bus (c) width (d) The full moon -
13.💬 How many paragraphs show on the page?
<p>Our school trip</p>
<!-- <p>My best friend</p> -->
<p>Good morning!</p> - 14.🔠 Which heading shows the BIGGEST text: <h4>, <h1>, <h2> or <h5>? (a) <h5> (b) <h2> (c) <h1> (d) <h4>
- 15.Which of these is a closing tag? (a) </body> (b) <body> (c) <b> (d) <li>
- 16.True or false: HTML on its own cannot make a form. (a) True (b) False
- 17.🧱 HTML gives a web page its ___. (a) speed (b) colours (c) sound (d) structure
- 18.Which of these is true of a web browser? (a) colours code to help us (b) stores a website’s files (c) hosts websites online (d) opens web pages for us
- 19.True or false: <ol> shows bullet points. (a) False (b) True
- 20.🔍 Which is the odd one out? (a) stores a website’s files (b) hosts websites online (c) shows pages from the web (d) answers page requests
-
21.🖼️ Which picture file does the browser load?
<img src="dog.jpg" alt="A happy dog" width="100"> (a) dog.jpg (b) moon.png (c) A happy dog (d) bus.jpg -
22.💬 How many paragraphs show on the page?
<p>Fun facts</p>
<!-- <p>My best friend</p> -->
<p>I love mangoes.</p> - 23.🔗 Which code links to about.html? (a) <a href="about.html"> (b) <a alt="about.html"> (c) <a src="about.html"> (d) <link about.html>
- 24.🌐 Which one colours code to help us? (a) a web browser (b) a web server (c) a code editor
- 25.🌐 Which one sends pages over the net? (a) a code editor (b) a web browser (c) a web server
- 26.🔠 Which heading shows the BIGGEST text: <h1>, <h4>, <h5> or <h2>? (a) <h2> (b) <h4> (c) <h1> (d) <h5>
- 27.💬 How does an HTML comment start? (a) # (b) <!-- (c) // (d) /*
- 28.🧩 An opening tag + content + a closing tag together make an ___. (a) editor (b) address (c) element (d) attribute
- 29.📝 You type 5 spaces between two words in a <p>. How does the browser show them? (a) as 5 spaces (b) as one space (c) as a dot (d) as a new line
-
30.🔠 How many headings are in this code?
<h1>Rain today</h1>
<p>My best friend</p>
<p>Good morning!</p>
<p>I love mangoes.</p> - 31.🔠 Are headings shown in bold by default? (a) Yes (b) No
- 32.📝 Does <input> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
- 33.📄 Where does <p> go: in the head or in the body? (a) in the head (b) in the body
-
34.🔗 Which address opens when you click this link?
<a href="about.html">About us</a> (a) contact.html (b) About us (c) https://example.com (d) about.html - 35.📄 Can HTML on its own show paragraphs? (a) Yes (b) No
- 36.📄 Can HTML on its own add pictures to a page? (a) No (b) Yes
- 37.🏷️ What does a closing tag have that an opening tag does not? (a) a dot . (b) a hash # (c) a dollar $ (d) a slash /
-
38.💬 Which text will NOT show on the page?
<!-- <p>My pets</p> -->
<p>My best friend</p>
<p>Our school trip</p>
<p>Good morning!</p> (a) My pets (b) My best friend (c) Our school trip (d) Good morning! -
39.📋 How many items does this list show?
<ul>
<li>Grapes</li>
<li>Banana</li>
</ul> - 40.True or false: HTML on its own cannot pick a random number. (a) False (b) True
Answer key
- 3
- in a new tab
- </html>
- a closing tag
- in the body
- Planets
- <h4>
- text with links
- 5
- height
- answers page requests
- The full moon
- 2
- <h1>
- </body>
- False
- structure
- opens web pages for us
- False
- shows pages from the web
- dog.jpg
- 2
- <a href="about.html">
- a code editor
- a web server
- <h1>
- <!--
- element
- as one space
- 1
- Yes
- an empty tag
- in the body
- about.html
- Yes
- Yes
- a slash /
- My pets
- 2
- True
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids