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 heading shows the SMALLEST text: <h1>, <h2>, <h4> or <h3>? (a) <h2> (b) <h4> (c) <h1> (d) <h3>
- 2.🔗 Which attribute holds the address of a link? (a) id (b) href (c) src (d) alt
-
3.🖼️ Which picture file does the browser load?
<img src="map.png" alt="Map of India" width="250"> (a) Map of India (b) map.png (c) cake.jpg (d) dog.jpg - 4.True or false: <ul> is an unordered list. (a) True (b) False
- 5.True or false: <img> has a closing tag. (a) False (b) True
- 6.📝 What does <hr> draw? (a) a table (b) a picture (c) a link (d) a line across the page
- 7.📝 What do we need to write HTML? (a) a paintbrush (b) a microphone (c) a printer (d) a plain text editor
- 8.📝 Does <ul> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
- 9.📄 Can HTML on its own make bullet lists? (a) No (b) Yes
- 10.Which of these is an empty tag? (a) <b> (b) <li> (c) <input> (d) <title>
- 11.🖼️ Which attribute of <img> names the picture file? (a) height (b) src (c) alt (d) width
- 12.Which of these is a closing tag? (a) <h1> (b) <body> (c) </p> (d) <title>
- 13.📄 Can HTML on its own make links to pages? (a) Yes (b) No
-
14.📋 How many items does this list show?
<ol>
<li>Guava</li>
<li>Papaya</li>
<li>Mango</li>
<li>Grapes</li>
</ol> - 15.True or false: a web browser shows pages from the web. (a) False (b) True
- 16.True or false: in <img>, height shows if the image fails. (a) True (b) False
- 17.🖼️ Which attribute of <img> sets how wide it is? (a) alt (b) height (c) width (d) src
-
18.🔍 One closing tag is missing. Which one?
<u>Good morning!
<h2>The red kite</h2>
<h3>Fun facts</h3> (a) </small> (b) </h3> (c) </u> (d) </h2> - 19.Which of these goes in the body? (a) <meta charset="utf-8"> (b) <link rel="stylesheet"> (c) <style> (d) <h1>
- 20.Which of these has a closing tag? (a) <ul> (b) <br> (c) <input> (d) <meta>
-
21.💬 How many paragraphs show on the page?
<p>My best friend</p>
<p>Hello, world!</p>
<p>My pets</p>
<p>The red kite</p>
<!-- <p>Rain today</p> --> - 22.🖼️ Which attribute of <img> tells which image to load? (a) width (b) height (c) src (d) alt
-
23.🔗 Where does this link open?
<a href="news.html">Visit the site</a> (a) in a new tab (b) in the same tab - 24.🔡 Are HTML tag names usually written in small letters? (a) No (b) Yes
- 25.🖼️ Which tag puts a picture on a page? (a) <img> (b) <pic> (c) <p> (d) <a>
- 26.🔢 In a basic web page file, which comes first: “</head>” or “</html>”? (a) </head> (b) </html>
-
27.🖼️ How many pixels wide is the picture drawn?
<img src="fort.jpg" alt="An old fort" width="200"> -
28.🔠 How many headings are in this code?
<h1>My pets</h1>
<h2>Hello, world!</h2>
<h3>Cricket is fun.</h3> - 29.True or false: <li> is one item of a list. (a) False (b) True
- 30.📝 Does <h1> have a closing tag, or is it an empty tag? (a) has a closing tag (b) an empty tag
- 31.📄 What is the first line of an HTML5 page? (a) <head> (b) <!DOCTYPE html> (c) <html> (d) <body>
-
32.💬 How many paragraphs show on the page?
<!-- <p>Cricket is fun.</p> -->
<!-- <p>My best friend</p> -->
<p>Good morning!</p>
<!-- <p>Our school trip</p> --> - 33.True or false: a code editor shows pages from the web. (a) True (b) False
-
34.🔍 Which line is missing its closing tag?
line 1: <em>Rain today
line 2: <i>Fun facts</i>
line 3: <h3>I love mangoes.</h3> (a) line 2 (b) line 1 (c) line 3 - 35.True or false: <title> goes in the head. (a) True (b) False
-
36.📋 Does this list show bullets or numbers?
<ul>
<li>Jamun</li>
<li>Guava</li>
<li>Papaya</li>
</ul> (a) bullets (b) numbers - 37.📝 What does <p> make? (a) a picture (b) a table (c) a link (d) a paragraph
-
38.💬 How many paragraphs show on the page?
<!-- <p>I love mangoes.</p> -->
<p>Hello, world!</p>
<!-- <p>Cricket is fun.</p> -->
<!-- <p>Our school trip</p> -->
<p>My pets</p> -
39.🔗 Which address opens when you click this link?
<a href="contact.html">Contact us</a> (a) maths.html (b) https://example.com (c) Contact us (d) contact.html - 40.🔗 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>
Answer key
- <h4>
- href
- map.png
- True
- False
- a line across the page
- a plain text editor
- has a closing tag
- Yes
- <input>
- src
- </p>
- Yes
- 4
- True
- False
- width
- </u>
- <h1>
- <ul>
- 4
- src
- in the same tab
- Yes
- <img>
- </head>
- 200
- 3
- True
- has a closing tag
- <!DOCTYPE html>
- 1
- False
- line 1
- True
- bullets
- a paragraph
- 2
- contact.html
- <a href="about.html">
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids