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 of these goes in the body? (a) <link rel="stylesheet"> (b) <style> (c) <table> (d) <meta charset="utf-8">
- 2.🔗 Which code links to about.html? (a) <link about.html> (b) <a alt="about.html"> (c) <a src="about.html"> (d) <a href="about.html">
-
3.🔗 Where does this link open?
<a href="art.html">About us</a> (a) in a new tab (b) in the same tab - 4.🔠 Which heading shows the SMALLEST text: <h1>, <h4>, <h5> or <h3>? (a) <h1> (b) <h3> (c) <h4> (d) <h5>
-
5.📝 On how many lines does the browser show this paragraph?
<p>Rivers flow<br>Kites fly high</p> - 6.💬 How does an HTML comment start? (a) /* (b) <!-- (c) // (d) #
- 7.True or false: HTML on its own can make links to pages. (a) False (b) True
- 8.🧩 An opening tag + content + a closing tag together make an ___. (a) attribute (b) editor (c) address (d) element
-
9.📋 What number does the browser show next to “Banana”?
<ol>
<li>Mango</li>
<li>Papaya</li>
<li>Banana</li>
<li>Orange</li>
</ol> -
10.📝 How many paragraphs does this code make?
<p>Fun facts</p>
<h2>My pets</h2>
<h2>Hello, world!</h2> - 11.Which of these goes in the head? (a) <ul> (b) <link rel="stylesheet"> (c) <a> (d) <h1>
-
12.🔗 Which words do you click on?
<a href="maths.html">Maths fun</a> (a) Art corner (b) maths.html (c) href (d) Maths fun -
13.📋 Does this list show bullets or numbers?
<ul>
<li>Mango</li>
<li>Guava</li>
</ul> (a) numbers (b) bullets -
14.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>My Hobbies</title>
</head>
<body>
<h1>Easy snacks</h1>
<p>I like to read.</p>
</body>
</html> (a) I like to read. (b) index.html (c) My Hobbies (d) Easy snacks - 15.🏷️ What does a closing tag have that an opening tag does not? (a) a hash # (b) a slash / (c) a dot . (d) a dollar $
-
16.🔗 Which words do you click on?
<a href="contact.html">Contact us</a> (a) href (b) Contact us (c) Visit the site (d) contact.html -
17.💬 Which text will NOT show on the page?
<p>Good morning!</p>
<p>Our school trip</p>
<!-- <p>Rain today</p> --> (a) Good morning! (b) Rain today (c) Our school trip - 18.🔢 In a basic web page file, which comes first: “</body>” or “<!DOCTYPE html>”? (a) </body> (b) <!DOCTYPE html>
- 19.True or false: <link rel="stylesheet"> goes in the body. (a) True (b) False
-
20.🔠 How many headings are in this code?
<h1>Fun facts</h1>
<h3>Good morning!</h3>
<h2>Good morning!</h2> - 21.🔠 Are headings shown in bold by default? (a) Yes (b) No
-
22.🔗 Where does this link open?
<a href="quiz.html">Contact us</a> (a) in a new tab (b) in the same tab - 23.Which of these goes in the body? (a) <meta charset="utf-8"> (b) <img> (c) <style> (d) <link rel="stylesheet">
-
24.🔗 Where does this link open?
<a href="about.html" target="_blank">School news</a> (a) in a new tab (b) in the same tab -
25.🔠 How many headings are in this code?
<h1>Good morning!</h1>
<p>Hello, world!</p>
<h2>Fun facts</h2>
<h4>My best friend</h4> -
26.🔗 Which words do you click on?
<a href="about.html">Visit the site</a> (a) about.html (b) Visit the site (c) href (d) Maths fun -
27.🔗 Where does this link open?
<a href="https://example.com" target="_blank">Contact us</a> (a) in the same tab (b) in a new tab -
28.🔗 Which words do you click on?
<a href="news.html">School news</a> (a) news.html (b) School news (c) Take the quiz (d) href - 29.📝 You type 5 spaces between two words in a <p>. How does the browser show them? (a) as 5 spaces (b) as a new line (c) as a dot (d) as one space
- 30.📋 Which tag goes around each item of a list? (a) <ul> (b) <p> (c) <ol> (d) <li>
- 31.🔠 Which heading shows the SMALLEST text: <h6>, <h2>, <h3> or <h1>? (a) <h6> (b) <h3> (c) <h2> (d) <h1>
-
32.💬 How many paragraphs show on the page?
<!-- <p>Our school trip</p> -->
<!-- <p>Hello, world!</p> -->
<!-- <p>My pets</p> -->
<p>Fun facts</p> -
33.🔠 How many headings are in this code?
<h1>Fun facts</h1>
<h3>Good morning!</h3>
<p>Fun facts</p>
<h2>My best friend</h2>
<h2>Fun facts</h2> - 34.🔠 Which heading shows the SMALLEST text: <h1>, <h2>, <h6> or <h5>? (a) <h1> (b) <h5> (c) <h2> (d) <h6>
- 35.🏷️ Is </body> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
-
36.🖼️ How many pixels wide is the picture drawn?
<img src="dog.jpg" alt="A happy dog" width="50"> -
37.📄 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) Welcome! (b) body (c) Space Facts (d) We won by 5 runs. - 38.📄 Can HTML on its own keep a high score? (a) No (b) Yes
- 39.🖼️ Which attribute of <img> sets how tall it is? (a) src (b) height (c) width (d) alt
- 40.🔠 Which heading shows the BIGGEST text: <h5>, <h6>, <h4> or <h1>? (a) <h5> (b) <h1> (c) <h4> (d) <h6>
Answer key
- <table>
- <a href="about.html">
- in the same tab
- <h5>
- 2
- <!--
- True
- element
- 3
- 1
- <link rel="stylesheet">
- Maths fun
- bullets
- My Hobbies
- a slash /
- Contact us
- Rain today
- <!DOCTYPE html>
- False
- 3
- Yes
- in the same tab
- <img>
- in a new tab
- 3
- Visit the site
- in a new tab
- School news
- as one space
- <li>
- <h6>
- 1
- 4
- <h6>
- a closing tag
- 50
- Welcome!
- No
- height
- <h1>
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids