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.True or false: in <img>, alt tells which image to load. (a) False (b) True
- 2.📄 Can HTML on its own make bullet lists? (a) Yes (b) No
- 3.🖼️ Which attribute of <img> sets how tall it is? (a) height (b) width (c) alt (d) src
- 4.📝 You type 5 spaces between two words in a <p>. How does the browser show them? (a) as a dot (b) as 5 spaces (c) as a new line (d) as one space
- 5.📝 What does <br> do? (a) adds a picture (b) makes text bold (c) makes a list (d) starts a new line
-
6.🔍 Which line is missing its closing tag?
line 1: <i>Our school trip</i>
line 2: <h1>My best friend
line 3: <h2>The red kite</h2> (a) line 1 (b) line 3 (c) line 2 - 7.🔍 Which is the odd one out? (a) stores a website’s files (b) sends pages over the net (c) colours code to help us (d) hosts websites online
- 8.📄 Which part holds everything you see on the page? (a) the body (b) the title (c) the head (d) the doctype
-
9.📝 How many paragraphs does this code make?
<p>My best friend</p>
<p>The red kite</p>
<p>Hello, world!</p> -
10.🔍 One closing tag is missing. Which one?
<h3>Hello, world!</h3>
<small>Fun facts
<i>Our school trip</i> (a) </p> (b) </h3> (c) </i> (d) </small> - 11.True or false: HTML on its own cannot make tables. (a) False (b) True
- 12.True or false: in <img>, height sets how tall it is. (a) False (b) True
- 13.Which of these has a closing tag? (a) <li> (b) <input> (c) <hr> (d) <br>
- 14.🏷️ Is </body> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
- 15.🔠 Which heading shows the BIGGEST text: <h5>, <h2>, <h6> or <h4>? (a) <h5> (b) <h2> (c) <h4> (d) <h6>
- 16.🔗 Which code links to about.html? (a) <a src="about.html"> (b) <link about.html> (c) <a alt="about.html"> (d) <a href="about.html">
- 17.🖼️ Why do we add alt text to an image? (a) to colour it (b) to load it faster (c) to make it bigger (d) to describe the image
-
18.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="kite.png" alt="A red kite" width="100"> (a) kite.png (b) Map of India (c) width (d) A red kite -
19.📝 How many paragraphs does this code make?
<p>Our school trip</p>
<h2>Fun facts</h2>
<h2>The red kite</h2>
<p>Good morning!</p> - 20.Which of these has a closing tag? (a) <ul> (b) <img> (c) <input> (d) <br>
- 21.🖼️ Which attribute of <img> shows if the image fails? (a) src (b) height (c) width (d) alt
- 22.🖼️ Does <img> need a closing tag? (a) Yes (b) No
- 23.📋 Which list tag is one item of a list? (a) <ul> (b) <ol> (c) <li>
- 24.🌐 Which one stores a website’s files? (a) a code editor (b) a web browser (c) a web server
- 25.📄 What is the first line of an HTML5 page? (a) <!DOCTYPE html> (b) <body> (c) <html> (d) <head>
-
26.📝 On how many lines does the browser show this paragraph?
<p>Roses are red<br>Rivers flow<br>Sky is blue<br>Kites fly high<br>Birds sing</p> - 27.📄 Can HTML on its own add pictures to a page? (a) Yes (b) No
- 28.📝 What does <p> make? (a) a link (b) a picture (c) a paragraph (d) a table
- 29.🔗 What does target="_blank" do to a link? (a) opens it in a new tab (b) makes it bold (c) makes it blank (d) hides the link
- 30.🔠 Which heading shows the BIGGEST text: <h1>, <h5>, <h6> or <h3>? (a) <h3> (b) <h6> (c) <h1> (d) <h5>
-
31.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>My Hobbies</title>
</head>
<body>
<h1>Match report</h1>
<p>Mars is red.</p>
</body>
</html> (a) index.html (b) My Hobbies (c) Mars is red. (d) Match report -
32.📋 Does this list show bullets or numbers?
<ul>
<li>Litchi</li>
<li>Jamun</li>
<li>Mango</li>
</ul> (a) numbers (b) bullets -
33.🔗 Which words do you click on?
<a href="maths.html">Contact us</a> (a) Visit the site (b) maths.html (c) href (d) Contact us -
34.💬 Which text will NOT show on the page?
<!-- <p>My pets</p> -->
<p>I love mangoes.</p>
<p>Cricket is fun.</p> (a) I love mangoes. (b) Cricket is fun. (c) My pets -
35.💬 How many paragraphs show on the page?
<!-- <p>Good morning!</p> -->
<p>The red kite</p>
<p>My pets</p> - 36.🔠 Which tag is the least important heading? (a) <p> (b) <h1> (c) <h6> (d) <h3>
-
37.📝 How many paragraphs does this code make?
<p>Rain today</p>
<p>My pets</p>
<h2>Cricket is fun.</h2>
<p>Our school trip</p> - 38.🔢 In a basic web page file, which comes FIRST? (a) <html> (b) </body> (c) </head> (d) <!DOCTYPE html>
-
39.📋 What number does the browser show next to “Orange”?
<ol start="8">
<li>Guava</li>
<li>Orange</li>
<li>Banana</li>
</ol> - 40.True or false: <link rel="stylesheet"> goes in the head. (a) True (b) False
Answer key
- False
- Yes
- height
- as one space
- starts a new line
- line 2
- colours code to help us
- the body
- 3
- </small>
- False
- True
- <li>
- a closing tag
- <h2>
- <a href="about.html">
- to describe the image
- A red kite
- 2
- <ul>
- alt
- No
- <li>
- a web server
- <!DOCTYPE html>
- 5
- Yes
- a paragraph
- opens it in a new tab
- <h1>
- My Hobbies
- bullets
- Contact us
- My pets
- 2
- <h6>
- 3
- <!DOCTYPE html>
- 9
- True
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids