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.💬 Why do coders write comments? (a) to add colour (b) to make links (c) to leave notes (d) to show pictures
- 2.🏷️ What does a closing tag have that an opening tag does not? (a) a slash / (b) a dot . (c) a hash # (d) a dollar $
- 3.💬 How does an HTML comment end? (a) --> (b) */ (c) // (d) >>
- 4.True or false: <li> is one item of a list. (a) True (b) False
- 5.🔠 Which heading shows the BIGGEST text: <h4>, <h2>, <h1> or <h3>? (a) <h4> (b) <h1> (c) <h3> (d) <h2>
- 6.📄 Where does <meta charset="utf-8"> go: in the head or in the body? (a) in the body (b) in the head
- 7.🖼️ Does <img> need a closing tag? (a) Yes (b) No
-
8.📋 How many items does this list show?
<ul>
<li>Banana</li>
<li>Guava</li>
<li>Litchi</li>
<li>Jamun</li>
</ul> - 9.💬 How does an HTML comment start? (a) <!-- (b) /* (c) // (d) #
-
10.🖼️ 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) An old fort (c) width (d) fort.jpg - 11.🔠 Are headings shown in bold by default? (a) No (b) Yes
- 12.🖼️ Why do we add alt text to an image? (a) to make it bigger (b) to load it faster (c) to colour it (d) to describe the image
-
13.🔠 How many headings are in this code?
<h1>My pets</h1>
<p>Hello, world!</p>
<h2>Cricket is fun.</h2>
<p>Cricket is fun.</p>
<h2>My pets</h2> - 14.🔢 In a basic web page file, which comes first: “<!DOCTYPE html>” or “</html>”? (a) </html> (b) <!DOCTYPE html>
- 15.🔠 Which tag is used for the main title on a page? (a) <h1> (b) <p> (c) <br> (d) <h6>
- 16.True or false: HTML on its own can make bullet lists. (a) False (b) True
- 17.🔠 How many heading levels does HTML have? (a) 3 (b) 6 (c) 10 (d) 4
- 18.🔠 Which heading shows the SMALLEST text: <h4>, <h2>, <h5> or <h1>? (a) <h4> (b) <h5> (c) <h1> (d) <h2>
- 19.True or false: in <img>, height sets how wide it is. (a) True (b) False
-
20.🔗 Where does this link open?
<a href="games.html">Take the quiz</a> (a) in the same tab (b) in a new tab - 21.Which of these is true of a code editor? (a) has an address bar (b) opens web pages for us (c) stores a website’s files (d) shows line numbers
- 22.📋 Which list tag is one item of a list? (a) <li> (b) <ul> (c) <ol>
- 23.🖼️ Which attribute of <img> describes the picture? (a) width (b) height (c) src (d) alt
- 24.🔠 Which heading shows the BIGGEST text: <h1>, <h6>, <h3> or <h4>? (a) <h6> (b) <h3> (c) <h4> (d) <h1>
-
25.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>Class 7 Blog</title>
</head>
<body>
<h1>Match report</h1>
<p>We won by 5 runs.</p>
</body>
</html> (a) Match report (b) We won by 5 runs. (c) index.html (d) Class 7 Blog - 26.True or false: HTML on its own cannot count button clicks. (a) True (b) False
-
27.🔍 One closing tag is missing. Which one?
<h1>The red kite</h1>
<h2>My pets
<u>Our school trip</u> (a) </h1> (b) </h3> (c) </u> (d) </h2> - 28.💬 Does the browser show comments on the page? (a) No (b) Yes
- 29.🔍 Which is the odd one out? (a) saves our .html files (b) is where we type code (c) opens web pages for us (d) colours code to help us
-
30.💬 How many paragraphs show on the page?
<p>My pets</p>
<!-- <p>Our school trip</p> -->
<!-- <p>Good morning!</p> --> - 31.📄 Can HTML on its own make headings? (a) Yes (b) No
- 32.🖼️ Which attribute of <img> shows if the image fails? (a) alt (b) width (c) height (d) src
- 33.📄 Can HTML on its own show paragraphs? (a) Yes (b) No
-
34.🖼️ How many pixels wide is the picture drawn?
<img src="fort.jpg" alt="An old fort" width="50"> - 35.🔢 In a basic web page file, which comes LAST? (a) <!DOCTYPE html> (b) <body> (c) </html> (d) </head>
-
36.📋 What number does the browser show next to “Orange”?
<ol start="2">
<li>Banana</li>
<li>Mango</li>
<li>Jamun</li>
<li>Orange</li>
</ol> - 37.🧩 An opening tag + content + a closing tag together make an ___. (a) element (b) editor (c) attribute (d) address
-
38.💬 How many paragraphs show on the page?
<!-- <p>My pets</p> -->
<p>Hello, world!</p>
<p>I love mangoes.</p>
<!-- <p>Fun facts</p> -->
<!-- <p>Our school trip</p> --> -
39.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>Cricket Club</title>
</head>
<body>
<h1>My drawings</h1>
<p>Mars is red.</p>
</body>
</html> (a) My drawings (b) Cricket Club (c) index.html (d) Mars is red. -
40.🔗 Which words do you click on?
<a href="about.html">About us</a> (a) about.html (b) href (c) About us (d) Contact us
Answer key
- to leave notes
- a slash /
- -->
- True
- <h1>
- in the head
- No
- 4
- <!--
- An old fort
- Yes
- to describe the image
- 3
- <!DOCTYPE html>
- <h1>
- True
- 6
- <h5>
- False
- in the same tab
- shows line numbers
- <li>
- alt
- <h1>
- Class 7 Blog
- True
- </h2>
- No
- opens web pages for us
- 1
- Yes
- alt
- Yes
- 50
- </html>
- 5
- element
- 2
- Cricket Club
- About us
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids