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.🏷️ What does a closing tag have that an opening tag does not? (a) a dot . (b) a slash / (c) a hash # (d) a dollar $
-
2.🖼️ Which picture file does the browser load?
<img src="fort.jpg" alt="An old fort" width="300"> (a) fort.jpg (b) tiger.jpg (c) kite.png (d) An old fort - 3.📛 In <a href="x.html">, what is href? (a) an attribute (b) an element name (c) a comment (d) a closing tag
- 4.🔠 Which heading shows the SMALLEST text: <h1>, <h5>, <h3> or <h6>? (a) <h6> (b) <h5> (c) <h1> (d) <h3>
- 5.🖼️ Does <img> need a closing tag? (a) No (b) Yes
- 6.🔗 What does target="_blank" do to a link? (a) opens it in a new tab (b) makes it blank (c) hides the link (d) makes it bold
-
7.💬 Which text will NOT show on the page?
<p>My pets</p>
<!-- <p>Fun facts</p> -->
<p>Hello, world!</p> (a) Fun facts (b) My pets (c) Hello, world! -
8.🔗 Which address opens when you click this link?
<a href="https://example.com">Contact us</a> (a) maths.html (b) art.html (c) Contact us (d) https://example.com -
9.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>Cricket Club</title>
</head>
<body>
<h1>Easy snacks</h1>
<p>Mars is red.</p>
</body>
</html> (a) Cricket Club (b) index.html (c) Mars is red. (d) Easy snacks -
10.🖼️ How many pixels wide is the picture drawn?
<img src="tiger.jpg" alt="A tiger asleep" width="400"> - 11.📋 Which list shows the steps of a recipe best? (a) <ul> (b) <hr> (c) <ol> (d) <br>
- 12.True or false: <style> goes in the body. (a) False (b) True
-
13.📋 What number does the browser show next to “Grapes”?
<ol>
<li>Guava</li>
<li>Jamun</li>
<li>Grapes</li>
<li>Papaya</li>
<li>Litchi</li>
</ol> -
14.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>Class 7 Blog</title>
</head>
<body>
<h1>Planets</h1>
<p>Thanks for visiting.</p>
</body>
</html> (a) Thanks for visiting. (b) Planets (c) index.html (d) Class 7 Blog -
15.🔍 One closing tag is missing. Which one?
<small>Cricket is fun.</small>
<h3>The red kite
<p>Good morning!</p> (a) </b> (b) </h3> (c) </small> (d) </p> -
16.📝 How many paragraphs does this code make?
<p>Rain today</p>
<h2>Cricket is fun.</h2>
<h2>My pets</h2>
<p>Hello, world!</p>
<p>Rain today</p>
<h2>I love mangoes.</h2> - 17.💬 Can anyone read your comments by viewing the page source? (a) Yes (b) No
-
18.📝 On how many lines does the browser show this paragraph?
<p>Rivers flow<br>Sky is blue</p> - 19.🏷️ Every HTML tag starts with which sign? (a) ( (b) { (c) [ (d) <
- 20.Which of these is an opening tag? (a) <b> (b) </body> (c) </li> (d) </h1>
- 21.🔡 Are HTML tag names usually written in small letters? (a) No (b) Yes
-
22.🔍 One closing tag is missing. Which one?
<h3>Cricket is fun.
<i>Hello, world!</i>
<h2>I love mangoes.</h2> (a) </i> (b) </h2> (c) </h3> (d) </h1> - 23.🔠 Which heading shows the SMALLEST text: <h5>, <h3>, <h1> or <h2>? (a) <h2> (b) <h1> (c) <h5> (d) <h3>
- 24.True or false: <table> goes in the body. (a) False (b) True
-
25.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>My Hobbies</title>
</head>
<body>
<h1>Planets</h1>
<p>Here is my best one.</p>
</body>
</html> (a) My Hobbies (b) index.html (c) Here is my best one. (d) Planets -
26.💬 How many paragraphs show on the page?
<p>Rain today</p>
<!-- <p>Good morning!</p> -->
<p>Our school trip</p> - 27.🔠 Which heading shows the SMALLEST text: <h2>, <h5>, <h1> or <h4>? (a) <h5> (b) <h4> (c) <h1> (d) <h2>
-
28.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="bus.jpg" alt="Our school bus" width="150"> (a) bus.jpg (b) An old fort (c) width (d) Our school bus -
29.📋 What number does the browser show next to “Litchi”?
<ol>
<li>Papaya</li>
<li>Orange</li>
<li>Guava</li>
<li>Jamun</li>
<li>Litchi</li>
</ol> -
30.🔗 Which address opens when you click this link?
<a href="contact.html">Take the quiz</a> (a) contact.html (b) https://example.com (c) maths.html (d) Take the quiz -
31.🔗 Where does this link open?
<a href="https://example.com" target="_blank">Contact us</a> (a) in a new tab (b) in the same tab -
32.📝 How many paragraphs does this code make?
<p>Good morning!</p>
<h2>Cricket is fun.</h2>
<h2>Our school trip</h2> - 33.🔍 Which is the odd one out? (a) has an address bar (b) shows pages from the web (c) opens web pages for us (d) hosts websites online
-
34.🔍 One closing tag is missing. Which one?
<u>My pets</u>
<i>Fun facts</i>
<small>Our school trip (a) </u> (b) </small> (c) </i> (d) </b> - 35.Which of these is true of a web server? (a) answers page requests (b) opens web pages for us (c) saves our .html files (d) is where we type code
- 36.True or false: <p> goes in the head. (a) True (b) False
-
37.📋 Does this list show bullets or numbers?
<ul>
<li>Grapes</li>
<li>Litchi</li>
<li>Papaya</li>
</ul> (a) numbers (b) bullets - 38.🔍 Which is the odd one out? (a) turns HTML into a page (b) colours code to help us (c) opens web pages for us (d) shows pages from the web
- 39.🖼️ Which attribute of <img> sets how wide it is? (a) height (b) alt (c) width (d) src
-
40.🔠 How many headings are in this code?
<h1>My pets</h1>
<h4>My best friend</h4>
<p>Our school trip</p>
Answer key
- a slash /
- fort.jpg
- an attribute
- <h6>
- No
- opens it in a new tab
- Fun facts
- https://example.com
- Cricket Club
- 400
- <ol>
- False
- 3
- Class 7 Blog
- </h3>
- 3
- Yes
- 2
- <
- <b>
- Yes
- </h3>
- <h5>
- True
- My Hobbies
- 2
- <h5>
- Our school bus
- 5
- contact.html
- in a new tab
- 1
- hosts websites online
- </small>
- answers page requests
- False
- bullets
- colours code to help us
- width
- 2
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids