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 of these is true of a code editor? (a) turns HTML into a page (b) opens web pages for us (c) sends pages over the net (d) is where we type code
- 2.🔢 In a basic web page file, which comes first: “<html>” or “<head>”? (a) <html> (b) <head>
- 3.📋 Which list tag goes inside ul or ol? (a) <ul> (b) <li> (c) <ol>
- 4.🏷️ Every HTML tag starts with which sign? (a) ( (b) < (c) [ (d) {
-
5.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>My Hobbies</title>
</head>
<body>
<h1>Welcome!</h1>
<p>Try this poha.</p>
</body>
</html> (a) body (b) Try this poha. (c) Welcome! (d) My Hobbies - 6.True or false: in <img>, src tells which image to load. (a) True (b) False
-
7.💬 Which text will NOT show on the page?
<p>The red kite</p>
<p>I love mangoes.</p>
<p>Cricket is fun.</p>
<!-- <p>Hello, world!</p> --> (a) I love mangoes. (b) Cricket is fun. (c) The red kite (d) Hello, world! - 8.True or false: HTML on its own cannot pick a random number. (a) False (b) True
-
9.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Class 7 Blog</title>
</head>
<body>
<h1>Planets</h1>
<p>We won by 5 runs.</p>
</body>
</html> (a) body (b) Planets (c) Class 7 Blog (d) We won by 5 runs. - 10.True or false: a code editor colours code to help us. (a) True (b) False
- 11.💬 Can anyone read your comments by viewing the page source? (a) No (b) Yes
- 12.🏷️ Is <p> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
- 13.🔢 In a basic web page file, which comes first: “</head>” or “<!DOCTYPE html>”? (a) </head> (b) <!DOCTYPE html>
-
14.🔗 Which address opens when you click this link?
<a href="art.html">Visit the site</a> (a) quiz.html (b) Visit the site (c) news.html (d) art.html -
15.💬 How many paragraphs show on the page?
<p>Fun facts</p>
<p>Rain today</p>
<!-- <p>Cricket is fun.</p> --> - 16.🏷️ Which is the closing tag for <h2>? (a) <h2/> (b) </h2> (c) <h2> (d) <\h2>
- 17.Which of these is an opening tag? (a) </li> (b) </b> (c) <li> (d) </h1>
- 18.Which of these is an opening tag? (a) <h1> (b) </p> (c) </h1> (d) </title>
-
19.💬 How many paragraphs show on the page?
<p>Good morning!</p>
<!-- <p>I love mangoes.</p> -->
<p>My best friend</p>
<p>My pets</p> - 20.🏷️ Which is the closing tag for <i>? (a) <\i> (b) <i> (c) </i> (d) <i/>
-
21.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Cricket Club</title>
</head>
<body>
<h1>My drawings</h1>
<p>We won by 5 runs.</p>
</body>
</html> (a) We won by 5 runs. (b) Cricket Club (c) My drawings (d) body - 22.🖼️ Which tag puts a picture on a page? (a) <pic> (b) <p> (c) <a> (d) <img>
- 23.True or false: <meta> has a closing tag. (a) False (b) True
- 24.🌐 Which one hosts websites online? (a) a web browser (b) a web server (c) a code editor
- 25.💬 Why do coders write comments? (a) to make links (b) to add colour (c) to show pictures (d) to leave notes
-
26.🔍 Which line is missing its closing tag?
line 1: <h3>My pets</h3>
line 2: <small>Hello, world!
line 3: <h2>Cricket is fun.</h2> (a) line 2 (b) line 3 (c) line 1 - 27.📄 Where does <style> go: in the head or in the body? (a) in the head (b) in the body
- 28.🖼️ Which attribute of <img> names the picture file? (a) width (b) src (c) height (d) alt
-
29.🔠 How many headings are in this code?
<h1>My pets</h1>
<h3>I love mangoes.</h3>
<h3>I love mangoes.</h3>
<h2>Cricket is fun.</h2> -
30.🔍 One closing tag is missing. Which one?
<small>Rain today
<strong>Hello, world!</strong>
<h3>Cricket is fun.</h3> (a) </h1> (b) </strong> (c) </h3> (d) </small> - 31.📝 What do we need to write HTML? (a) a paintbrush (b) a microphone (c) a printer (d) a plain text editor
- 32.True or false: in <img>, height shows if the image fails. (a) False (b) True
-
33.🔠 How many headings are in this code?
<h1>I love mangoes.</h1>
<p>Fun facts</p>
<p>Good morning!</p> -
34.🔗 Which words do you click on?
<a href="art.html">Play games</a> (a) About us (b) Play games (c) art.html (d) href -
35.📝 How many paragraphs does this code make?
<p>Rain today</p>
<h2>Good morning!</h2>
<p>Fun facts</p>
<p>Cricket is fun.</p>
<p>I love mangoes.</p>
<p>Fun facts</p> -
36.🔗 Where does this link open?
<a href="news.html" target="_blank">Art corner</a> (a) in a new tab (b) in the same tab - 37.🔗 Which tag makes a clickable link? (a) <img> (b) <a> (c) <link> (d) <p>
-
38.💬 How many paragraphs show on the page?
<!-- <p>Hello, world!</p> -->
<!-- <p>Cricket is fun.</p> -->
<p>Good morning!</p> - 39.True or false: <ol> goes inside ul or ol. (a) False (b) True
- 40.True or false: in <img>, alt sets how tall it is. (a) False (b) True
Answer key
- is where we type code
- <html>
- <li>
- <
- Welcome!
- True
- Hello, world!
- True
- Planets
- True
- Yes
- an opening tag
- <!DOCTYPE html>
- art.html
- 2
- </h2>
- <li>
- <h1>
- 3
- </i>
- My drawings
- <img>
- False
- a web server
- to leave notes
- line 2
- in the head
- src
- 4
- </small>
- a plain text editor
- False
- 1
- Play games
- 5
- in a new tab
- <a>
- 1
- False
- False
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids