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) <meta charset="utf-8"> (c) <img> (d) <style>
- 2.True or false: a code editor shows pages from the web. (a) True (b) False
- 3.True or false: <img> goes in the head. (a) True (b) False
- 4.True or false: HTML on its own can keep a high score. (a) True (b) False
- 5.True or false: <li> goes inside ul or ol. (a) False (b) True
- 6.🔠 Which heading shows the SMALLEST text: <h6>, <h1>, <h5> or <h2>? (a) <h1> (b) <h5> (c) <h2> (d) <h6>
- 7.Which of these is true of a web browser? (a) sends pages over the net (b) opens web pages for us (c) saves our .html files (d) stores a website’s files
-
8.🖼️ How many pixels wide is the picture drawn?
<img src="map.png" alt="Map of India" width="250"> - 9.True or false: <p> goes in the body. (a) False (b) True
- 10.True or false: a web browser is where we type code. (a) False (b) True
- 11.Which of these is an opening tag? (a) </h1> (b) </p> (c) </title> (d) <body>
- 12.True or false: a web server sends pages over the net. (a) False (b) True
- 13.📄 Where does <link rel="stylesheet"> go: in the head or in the body? (a) in the body (b) in the head
- 14.🔠 Which heading shows the BIGGEST text: <h3>, <h5>, <h1> or <h6>? (a) <h1> (b) <h6> (c) <h5> (d) <h3>
-
15.📝 On how many lines does the browser show this paragraph?
<p>Sky is blue<br>Rivers flow<br>Roses are red</p> - 16.True or false: in <img>, src is read by screen readers. (a) True (b) False
- 17.📄 Can HTML on its own pick a random number? (a) No (b) Yes
- 18.🔠 Which heading shows the SMALLEST text: <h2>, <h4>, <h3> or <h5>? (a) <h2> (b) <h4> (c) <h3> (d) <h5>
- 19.📄 Where does the text of <title> appear? (a) at the bottom (b) on the browser tab (c) in a big heading (d) nowhere
- 20.🔗 Which code links to about.html? (a) <a alt="about.html"> (b) <a href="about.html"> (c) <link about.html> (d) <a src="about.html">
-
21.🔠 How many headings are in this code?
<h1>Rain today</h1>
<h4>My best friend</h4>
<p>Fun facts</p> -
22.📝 How many paragraphs does this code make?
<p>Rain today</p>
<p>My pets</p>
<h2>My pets</h2>
<p>Fun facts</p>
<p>My pets</p> - 23.True or false: HTML on its own cannot make headings. (a) True (b) False
- 24.🖼️ Which attribute of <img> sets how tall it is? (a) alt (b) height (c) width (d) src
- 25.True or false: <ul> is an unordered list. (a) True (b) False
- 26.🔠 Which tag is the least important heading? (a) <p> (b) <h6> (c) <h3> (d) <h1>
-
27.📋 Does this list show bullets or numbers?
<ul>
<li>Banana</li>
<li>Orange</li>
</ul> (a) numbers (b) bullets -
28.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>My Hobbies</title>
</head>
<body>
<h1>Easy snacks</h1>
<p>Here is my best one.</p>
</body>
</html> (a) Here is my best one. (b) index.html (c) My Hobbies (d) Easy snacks -
29.💬 How many paragraphs show on the page?
<!-- <p>Fun facts</p> -->
<!-- <p>I love mangoes.</p> -->
<p>My best friend</p> - 30.🔠 Which heading shows the BIGGEST text: <h3>, <h5>, <h6> or <h1>? (a) <h6> (b) <h5> (c) <h1> (d) <h3>
- 31.🔠 Which heading shows the SMALLEST text: <h1>, <h3>, <h6> or <h2>? (a) <h6> (b) <h3> (c) <h1> (d) <h2>
- 32.💬 Why do coders write comments? (a) to show pictures (b) to make links (c) to leave notes (d) to add colour
-
33.💬 How many paragraphs show on the page?
<p>Fun facts</p>
<!-- <p>I love mangoes.</p> -->
<!-- <p>Our school trip</p> --> -
34.💬 How many paragraphs show on the page?
<!-- <p>My best friend</p> -->
<!-- <p>The red kite</p> -->
<p>Cricket is fun.</p>
<!-- <p>Hello, world!</p> -->
<p>Fun facts</p> - 35.💬 How does an HTML comment end? (a) // (b) */ (c) --> (d) >>
- 36.🖼️ Why do we add alt text to an image? (a) to load it faster (b) to make it bigger (c) to colour it (d) to describe the image
-
37.🔗 Where does this link open?
<a href="contact.html">About us</a> (a) in a new tab (b) in the same tab - 38.🔢 In a basic web page file, which comes first: “</head>” or “</body>”? (a) </body> (b) </head>
- 39.🔢 In a basic web page file, which comes first: “<!DOCTYPE html>” or “<head>”? (a) <!DOCTYPE html> (b) <head>
- 40.🔗 Which tag makes a clickable link? (a) <link> (b) <a> (c) <img> (d) <p>
Answer key
- <img>
- False
- False
- False
- True
- <h6>
- opens web pages for us
- 250
- True
- False
- <body>
- True
- in the head
- <h1>
- 3
- False
- No
- <h5>
- on the browser tab
- <a href="about.html">
- 2
- 4
- False
- height
- True
- <h6>
- bullets
- My Hobbies
- 1
- <h1>
- <h6>
- to leave notes
- 1
- 2
- -->
- to describe the image
- in the same tab
- </head>
- <!DOCTYPE html>
- <a>
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids