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 sets how tall it is. (a) False (b) True
-
2.💬 How many paragraphs show on the page?
<!-- <p>Rain today</p> -->
<!-- <p>My pets</p> -->
<!-- <p>Our school trip</p> -->
<p>Fun facts</p> - 3.🔡 Are HTML tag names usually written in small letters? (a) No (b) Yes
- 4.🔗 What does target="_blank" do to a link? (a) makes it bold (b) hides the link (c) opens it in a new tab (d) makes it blank
- 5.Which of these is a closing tag? (a) <b> (b) </b> (c) <body> (d) <h1>
- 6.🔗 Which code links to about.html? (a) <a src="about.html"> (b) <a alt="about.html"> (c) <link about.html> (d) <a href="about.html">
-
7.📋 Does this list show bullets or numbers?
<ul>
<li>Litchi</li>
<li>Jamun</li>
</ul> (a) bullets (b) numbers - 8.💬 Why do coders write comments? (a) to add colour (b) to make links (c) to show pictures (d) to leave notes
- 9.💬 How does an HTML comment start? (a) /* (b) # (c) // (d) <!--
-
10.📋 How many items does this list show?
<ul>
<li>Mango</li>
<li>Litchi</li>
</ul> -
11.🔗 Where does this link open?
<a href="contact.html">Take the quiz</a> (a) in a new tab (b) in the same tab -
12.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Cricket Club</title>
</head>
<body>
<h1>Easy snacks</h1>
<p>Try this poha.</p>
</body>
</html> (a) Try this poha. (b) Cricket Club (c) body (d) Easy snacks - 13.📄 What is the first line of an HTML5 page? (a) <head> (b) <html> (c) <body> (d) <!DOCTYPE html>
-
14.📝 On how many lines does the browser show this paragraph?
<p>Roses are red<br>Kites fly high<br>Birds sing<br>Rivers flow<br>Stars shine</p> - 15.🔗 Which tag makes a clickable link? (a) <link> (b) <a> (c) <img> (d) <p>
- 16.📄 Can HTML on its own make links to pages? (a) No (b) Yes
-
17.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>Space Facts</title>
</head>
<body>
<h1>All about me</h1>
<p>I like to read.</p>
</body>
</html> (a) I like to read. (b) All about me (c) index.html (d) Space Facts - 18.True or false: in <img>, src names the picture file. (a) False (b) True
- 19.🏷️ Is </p> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
-
20.🔗 Which address opens when you click this link?
<a href="about.html">Visit the site</a> (a) contact.html (b) https://example.com (c) Visit the site (d) about.html - 21.📝 What does <hr> draw? (a) a picture (b) a line across the page (c) a table (d) a link
- 22.📋 Which list tag shows bullet points? (a) <ol> (b) <ul> (c) <li>
- 23.True or false: <li> is an ordered list. (a) False (b) True
-
24.🔍 One closing tag is missing. Which one?
<strong>Rain today</strong>
<h2>My best friend
<small>Our school trip</small> (a) </strong> (b) </small> (c) </h2> (d) </p> -
25.📝 On how many lines does the browser show this paragraph?
<p>Roses are red<br>Sky is blue<br>Stars shine<br>Rivers flow</p> - 26.🔠 Which heading shows the SMALLEST text: <h1>, <h3>, <h4> or <h6>? (a) <h4> (b) <h6> (c) <h3> (d) <h1>
-
27.🔗 Which address opens when you click this link?
<a href="https://example.com">Play games</a> (a) art.html (b) Play games (c) maths.html (d) https://example.com -
28.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>My Hobbies</title>
</head>
<body>
<h1>Planets</h1>
<p>We won by 5 runs.</p>
</body>
</html> (a) Planets (b) body (c) My Hobbies (d) We won by 5 runs. - 29.📋 Which list tag lists things in any order? (a) <li> (b) <ol> (c) <ul>
-
30.🖼️ Which picture file does the browser load?
<img src="bus.jpg" alt="Our school bus" width="100"> (a) tiger.jpg (b) Our school bus (c) fort.jpg (d) bus.jpg -
31.📋 How many items does this list show?
<ul>
<li>Orange</li>
<li>Banana</li>
<li>Litchi</li>
<li>Papaya</li>
<li>Mango</li>
</ul> - 32.🖼️ Which attribute of <img> shows if the image fails? (a) src (b) height (c) alt (d) width
- 33.🔍 Which is the odd one out? (a) stores a website’s files (b) sends pages over the net (c) is where we type code (d) answers page requests
-
34.🔍 One closing tag is missing. Which one?
<b>Our school trip</b>
<p>My best friend</p>
<strong>Hello, world! (a) </u> (b) </b> (c) </p> (d) </strong> - 35.True or false: HTML on its own can keep a high score. (a) True (b) False
-
36.🔗 Which address opens when you click this link?
<a href="games.html">About us</a> (a) contact.html (b) about.html (c) games.html (d) About us - 37.💾 A web page file usually ends with which extension? (a) .mp3 (b) .txt (c) .html (d) .png
- 38.🔗 Which attribute holds the address of a link? (a) src (b) alt (c) id (d) href
- 39.📄 Where does <meta charset="utf-8"> go: in the head or in the body? (a) in the head (b) in the body
- 40.Which of these is an empty tag? (a) <img> (b) <h1> (c) <ul> (d) <title>
Answer key
- False
- 1
- Yes
- opens it in a new tab
- </b>
- <a href="about.html">
- bullets
- to leave notes
- <!--
- 2
- in the same tab
- Easy snacks
- <!DOCTYPE html>
- 5
- <a>
- Yes
- Space Facts
- True
- a closing tag
- about.html
- a line across the page
- <ul>
- False
- </h2>
- 4
- <h6>
- https://example.com
- Planets
- <ul>
- bus.jpg
- 5
- alt
- is where we type code
- </strong>
- False
- games.html
- .html
- href
- in the head
- <img>
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids