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.📄 Where does <p> go: in the head or in the body? (a) in the body (b) in the head
-
2.📝 How many paragraphs does this code make?
<p>The red kite</p>
<p>Good morning!</p>
<p>Cricket is fun.</p>
<h2>Hello, world!</h2> - 3.Which of these is a closing tag? (a) </b> (b) <body> (c) <p> (d) <title>
- 4.🏷️ Is </title> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
- 5.🔗 What does target="_blank" do to a link? (a) opens it in a new tab (b) makes it blank (c) hides the link (d) makes it bold
- 6.Which of these has a closing tag? (a) <input> (b) <img> (c) <hr> (d) <h1>
- 7.📄 Where does <meta charset="utf-8"> go: in the head or in the body? (a) in the body (b) in the head
-
8.📝 How many paragraphs does this code make?
<p>My pets</p>
<h2>Hello, world!</h2>
<h2>My pets</h2>
<h2>My best friend</h2>
<p>Fun facts</p>
<p>Fun facts</p> - 9.💬 How does an HTML comment end? (a) // (b) */ (c) >> (d) -->
- 10.Which of these has a closing tag? (a) <hr> (b) <br> (c) <title> (d) <input>
- 11.True or false: <ul> is an empty tag. (a) True (b) False
- 12.🔗 Which tag makes a clickable link? (a) <p> (b) <img> (c) <a> (d) <link>
- 13.True or false: <hr> is an empty tag. (a) False (b) True
-
14.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Riya’s Recipes</title>
</head>
<body>
<h1>Match report</h1>
<p>Try this poha.</p>
</body>
</html> (a) body (b) Match report (c) Try this poha. (d) Riya’s Recipes - 15.True or false: in <img>, alt describes the picture. (a) True (b) False
-
16.📝 On how many lines does the browser show this paragraph?
<p>Sky is blue<br>Roses are red<br>Kites fly high<br>Stars shine<br>Rivers flow</p> -
17.📝 On how many lines does the browser show this paragraph?
<p>Kites fly high<br>Stars shine</p> - 18.🔠 Which heading shows the SMALLEST text: <h6>, <h2>, <h1> or <h3>? (a) <h3> (b) <h2> (c) <h1> (d) <h6>
- 19.Which of these has a closing tag? (a) <meta> (b) <img> (c) <li> (d) <input>
- 20.🔠 How many <h1> headings should a page usually have? (a) 3 (b) 10 (c) 1 (d) 6
- 21.📛 In <a href="x.html">, what is href? (a) an attribute (b) a closing tag (c) a comment (d) an element name
-
22.🖼️ How many pixels wide is the picture drawn?
<img src="fort.jpg" alt="An old fort" width="150"> -
23.💬 Which text will NOT show on the page?
<p>My pets</p>
<!-- <p>My best friend</p> -->
<p>Rain today</p> (a) My best friend (b) Rain today (c) My pets - 24.💬 How does an HTML comment start? (a) /* (b) // (c) # (d) <!--
- 25.🖼️ Which tag puts a picture on a page? (a) <pic> (b) <p> (c) <img> (d) <a>
-
26.🔠 How many headings are in this code?
<h1>The red kite</h1>
<p>The red kite</p>
<p>Hello, world!</p>
<h2>My pets</h2>
<p>My best friend</p> - 27.📋 Which list shows the steps of a recipe best? (a) <hr> (b) <ul> (c) <br> (d) <ol>
-
28.📝 On how many lines does the browser show this paragraph?
<p>Kites fly high<br>Roses are red<br>Birds sing</p> -
29.🖼️ Which picture file does the browser load?
<img src="cake.jpg" alt="Birthday cake" width="50"> (a) dog.jpg (b) moon.png (c) Birthday cake (d) cake.jpg - 30.📄 Can HTML on its own make a form? (a) Yes (b) No
- 31.🔠 How many heading levels does HTML have? (a) 4 (b) 3 (c) 6 (d) 10
- 32.🔗 Which code links to about.html? (a) <a alt="about.html"> (b) <a src="about.html"> (c) <a href="about.html"> (d) <link about.html>
-
33.📋 How many items does this list show?
<ol>
<li>Mango</li>
<li>Guava</li>
<li>Banana</li>
<li>Grapes</li>
</ol> - 34.🔡 Are HTML tag names usually written in small letters? (a) Yes (b) No
-
35.🔍 Which line is missing its closing tag?
line 1: <b>I love mangoes.
line 2: <h1>Rain today</h1>
line 3: <em>Fun facts</em> (a) line 1 (b) line 3 (c) line 2 - 36.🔗 What does HyperText mean? (a) secret text (b) text with links (c) text in colour (d) very big text
- 37.📋 Which list suits a shopping list in any order? (a) <ul> (b) <br> (c) <hr> (d) <ol>
-
38.📝 On how many lines does the browser show this paragraph?
<p>Stars shine<br>Birds sing<br>Rivers flow<br>Sky is blue</p> -
39.🔍 Which line is missing its closing tag?
line 1: <h1>Good morning!</h1>
line 2: <h2>Fun facts
line 3: <u>Our school trip</u> (a) line 3 (b) line 2 (c) line 1 - 40.Which of these is an opening tag? (a) </p> (b) </body> (c) <p> (d) </title>
Answer key
- in the body
- 3
- </b>
- a closing tag
- opens it in a new tab
- <h1>
- in the head
- 3
- -->
- <title>
- False
- <a>
- True
- Match report
- True
- 5
- 2
- <h6>
- <li>
- 1
- an attribute
- 150
- My best friend
- <!--
- <img>
- 2
- <ol>
- 3
- cake.jpg
- Yes
- 6
- <a href="about.html">
- 4
- Yes
- line 1
- text with links
- <ul>
- 4
- line 2
- <p>
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids