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 attribute of <img> tells which image to load? (a) src (b) alt (c) width (d) height
- 2.Which of these is an opening tag? (a) </p> (b) </body> (c) </h1> (d) <b>
-
3.💬 How many paragraphs show on the page?
<!-- <p>I love mangoes.</p> -->
<p>Cricket is fun.</p>
<!-- <p>Good morning!</p> --> -
4.🔗 Which words do you click on?
<a href="games.html">Visit the site</a> (a) games.html (b) Visit the site (c) Maths fun (d) href - 5.🖼️ Which attribute of <img> is read by screen readers? (a) src (b) alt (c) width (d) height
-
6.🔗 Which words do you click on?
<a href="about.html">Art corner</a> (a) about.html (b) School news (c) href (d) Art corner - 7.Which of these is true of a web server? (a) colours code to help us (b) shows pages from the web (c) is where we type code (d) stores a website’s files
-
8.🔍 One closing tag is missing. Which one?
<em>My pets</em>
<small>Good morning!
<h2>The red kite</h2> (a) </small> (b) </h3> (c) </em> (d) </h2> - 9.💬 How does an HTML comment start? (a) /* (b) # (c) <!-- (d) //
- 10.🔗 What does target="_blank" do to a link? (a) opens it in a new tab (b) hides the link (c) makes it bold (d) makes it blank
-
11.📝 How many paragraphs does this code make?
<p>Fun facts</p>
<h2>Fun facts</h2>
<p>My best friend</p>
<h2>The red kite</h2>
<p>Good morning!</p> - 12.💬 Does the browser show comments on the page? (a) Yes (b) No
-
13.🖼️ Which picture file does the browser load?
<img src="dog.jpg" alt="A happy dog" width="200"> (a) bus.jpg (b) dog.jpg (c) A happy dog (d) moon.png -
14.📋 How many items does this list show?
<ul>
<li>Papaya</li>
<li>Orange</li>
<li>Mango</li>
</ul> - 15.True or false: <b> has a closing tag. (a) False (b) True
- 16.📋 Which list tag shows bullet points? (a) <ul> (b) <ol> (c) <li>
- 17.True or false: a code editor turns HTML into a page. (a) False (b) True
- 18.🔗 Which tag makes a clickable link? (a) <link> (b) <a> (c) <p> (d) <img>
-
19.📝 How many paragraphs does this code make?
<p>My pets</p>
<h2>Our school trip</h2>
<h2>My pets</h2>
<p>My pets</p>
<p>My best friend</p>
<h2>My best friend</h2> - 20.🖼️ Which attribute of <img> sets how wide it is? (a) height (b) width (c) alt (d) src
-
21.🔗 Where does this link open?
<a href="contact.html" target="_blank">About us</a> (a) in a new tab (b) in the same tab -
22.🖼️ Which picture file does the browser load?
<img src="kite.png" alt="A red kite" width="150"> (a) kite.png (b) map.png (c) A red kite (d) cake.jpg - 23.🌐 Which one is where we type code? (a) a code editor (b) a web server (c) a web browser
-
24.📋 How many items does this list show?
<ul>
<li>Guava</li>
<li>Banana</li>
<li>Jamun</li>
<li>Mango</li>
</ul> -
25.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Art Gallery</title>
</head>
<body>
<h1>Planets</h1>
<p>Mars is red.</p>
</body>
</html> (a) body (b) Art Gallery (c) Planets (d) Mars is red. - 26.🔠 Which heading shows the BIGGEST text: <h3>, <h5>, <h4> or <h6>? (a) <h4> (b) <h5> (c) <h6> (d) <h3>
-
27.🔠 How many headings are in this code?
<h1>My best friend</h1>
<p>My best friend</p>
<h3>I love mangoes.</h3> - 28.🖼️ Which tag puts a picture on a page? (a) <p> (b) <img> (c) <a> (d) <pic>
- 29.Which of these is an empty tag? (a) <p> (b) <img> (c) <h1> (d) <ul>
- 30.🔠 Which heading shows the SMALLEST text: <h3>, <h4>, <h6> or <h1>? (a) <h1> (b) <h3> (c) <h4> (d) <h6>
-
31.🔠 How many headings are in this code?
<h1>My pets</h1>
<p>Good morning!</p>
<p>Good morning!</p> - 32.True or false: HTML on its own cannot add up two numbers. (a) False (b) True
- 33.🏷️ Is </h1> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
-
34.📝 How many paragraphs does this code make?
<p>Our school trip</p>
<h2>I love mangoes.</h2>
<h2>I love mangoes.</h2>
<p>My pets</p> - 35.True or false: in <img>, alt shows if the image fails. (a) False (b) True
-
36.💬 How many paragraphs show on the page?
<!-- <p>I love mangoes.</p> -->
<p>My pets</p>
<p>Good morning!</p> -
37.🔗 Which words do you click on?
<a href="quiz.html">School news</a> (a) School news (b) quiz.html (c) href (d) Take the quiz - 38.True or false: HTML on its own cannot run a game loop. (a) True (b) False
-
39.🔍 One closing tag is missing. Which one?
<strong>Our school trip</strong>
<p>My pets
<h3>Hello, world!</h3> (a) </strong> (b) </h3> (c) </i> (d) </p> -
40.📝 On how many lines does the browser show this paragraph?
<p>Roses are red<br>Birds sing<br>Rivers flow</p>
Answer key
- src
- <b>
- 1
- Visit the site
- alt
- Art corner
- stores a website’s files
- </small>
- <!--
- opens it in a new tab
- 3
- No
- dog.jpg
- 3
- True
- <ul>
- False
- <a>
- 3
- width
- in a new tab
- kite.png
- a code editor
- 4
- Planets
- <h3>
- 2
- <img>
- <img>
- <h6>
- 1
- True
- a closing tag
- 2
- True
- 2
- School news
- True
- </p>
- 3
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids