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> sets how tall it is? (a) src (b) width (c) alt (d) height
- 2.🖼️ Why do we add alt text to an image? (a) to colour it (b) to make it bigger (c) to load it faster (d) to describe the image
- 3.Which of these is true of a code editor? (a) shows pages from the web (b) has an address bar (c) saves our .html files (d) sends pages over the net
- 4.📋 Which list shows the steps of a recipe best? (a) <ul> (b) <br> (c) <hr> (d) <ol>
- 5.Which of these is true of a web browser? (a) hosts websites online (b) colours code to help us (c) stores a website’s files (d) opens web pages for us
-
6.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>My Hobbies</title>
</head>
<body>
<h1>My drawings</h1>
<p>Mars is red.</p>
</body>
</html> (a) Mars is red. (b) index.html (c) My drawings (d) My Hobbies -
7.🔗 Where does this link open?
<a href="quiz.html">Contact us</a> (a) in the same tab (b) in a new tab -
8.🔍 One closing tag is missing. Which one?
<small>Our school trip</small>
<h3>Hello, world!</h3>
<h2>I love mangoes. (a) </h3> (b) </small> (c) </h1> (d) </h2> - 9.🏷️ Is <h1> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
-
10.🖼️ How many pixels wide is the picture drawn?
<img src="bus.jpg" alt="Our school bus" width="400"> -
11.💬 How many paragraphs show on the page?
<!-- <p>Fun facts</p> -->
<!-- <p>Good morning!</p> -->
<p>Cricket is fun.</p> -
12.🔍 One closing tag is missing. Which one?
<small>My best friend</small>
<h2>I love mangoes.
<b>Hello, world!</b> (a) </em> (b) </h2> (c) </small> (d) </b> -
13.🔠 How many headings are in this code?
<h1>Good morning!</h1>
<h2>Hello, world!</h2>
<p>Rain today</p> -
14.💬 Which text will NOT show on the page?
<p>Cricket is fun.</p>
<p>Fun facts</p>
<!-- <p>My pets</p> --> (a) Cricket is fun. (b) My pets (c) Fun facts - 15.True or false: in <img>, alt tells which image to load. (a) True (b) False
- 16.🔠 How many <h1> headings should a page usually have? (a) 10 (b) 3 (c) 6 (d) 1
- 17.📄 Can HTML on its own make headings? (a) Yes (b) No
- 18.🏷️ Every HTML tag starts with which sign? (a) [ (b) { (c) ( (d) <
- 19.💬 How does an HTML comment end? (a) --> (b) >> (c) */ (d) //
- 20.📝 Does <b> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
- 21.🖼️ Which attribute of <img> shows if the image fails? (a) width (b) height (c) alt (d) src
-
22.💬 How many paragraphs show on the page?
<!-- <p>My pets</p> -->
<!-- <p>My best friend</p> -->
<!-- <p>Fun facts</p> -->
<p>I love mangoes.</p> -
23.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>Riya’s Recipes</title>
</head>
<body>
<h1>Easy snacks</h1>
<p>Thanks for visiting.</p>
</body>
</html> (a) index.html (b) Thanks for visiting. (c) Riya’s Recipes (d) Easy snacks - 24.True or false: <ul> goes in the head. (a) True (b) False
- 25.🏷️ What does a closing tag have that an opening tag does not? (a) a dollar $ (b) a dot . (c) a hash # (d) a slash /
-
26.💬 How many paragraphs show on the page?
<!-- <p>Rain today</p> -->
<p>Fun facts</p>
<p>The red kite</p> - 27.True or false: <hr> is an empty tag. (a) False (b) True
- 28.True or false: HTML on its own can pick a random number. (a) True (b) False
- 29.🔠 Which heading shows the BIGGEST text: <h1>, <h6>, <h4> or <h3>? (a) <h4> (b) <h6> (c) <h3> (d) <h1>
- 30.True or false: <a> goes in the head. (a) False (b) True
-
31.🔠 How many headings are in this code?
<h1>The red kite</h1>
<h4>The red kite</h4>
<h2>Fun facts</h2>
<p>Our school trip</p> - 32.True or false: <meta charset="utf-8"> goes in the head. (a) True (b) False
- 33.🔠 Are headings shown in bold by default? (a) Yes (b) No
-
34.🔗 Which words do you click on?
<a href="games.html">Take the quiz</a> (a) Take the quiz (b) href (c) Play games (d) games.html -
35.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="tiger.jpg" alt="A tiger asleep" width="150"> (a) A tiger asleep (b) width (c) A red kite (d) tiger.jpg - 36.🔢 In a basic web page file, which comes first: “</body>” or “<html>”? (a) <html> (b) </body>
-
37.💬 How many paragraphs show on the page?
<!-- <p>Our school trip</p> -->
<p>Rain today</p>
<!-- <p>The red kite</p> --> -
38.📋 Does this list show bullets or numbers?
<ul>
<li>Banana</li>
<li>Guava</li>
<li>Jamun</li>
</ul> (a) numbers (b) bullets - 39.💾 A web page file usually ends with which extension? (a) .mp3 (b) .png (c) .html (d) .txt
- 40.🔠 Which heading shows the BIGGEST text: <h3>, <h4>, <h5> or <h1>? (a) <h3> (b) <h4> (c) <h5> (d) <h1>
Answer key
- height
- to describe the image
- saves our .html files
- <ol>
- opens web pages for us
- My Hobbies
- in the same tab
- </h2>
- an opening tag
- 400
- 1
- </h2>
- 2
- My pets
- False
- 1
- Yes
- <
- -->
- has a closing tag
- alt
- 1
- Riya’s Recipes
- False
- a slash /
- 2
- True
- False
- <h1>
- False
- 3
- True
- Yes
- Take the quiz
- A tiger asleep
- <html>
- 1
- bullets
- .html
- <h1>
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids