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 one shows pages from the web? (a) a web server (b) a code editor (c) a web browser
- 2.True or false: <link rel="stylesheet"> goes in the head. (a) False (b) True
- 3.🖼️ Does <img> need a closing tag? (a) No (b) Yes
-
4.💬 How many paragraphs show on the page?
<!-- <p>Hello, world!</p> -->
<p>Cricket is fun.</p>
<p>My best friend</p>
<!-- <p>The red kite</p> -->
<p>My pets</p> -
5.🔠 How many headings are in this code?
<h1>My best friend</h1>
<h2>My pets</h2>
<h3>My best friend</h3>
<h2>My best friend</h2>
<h2>Good morning!</h2> - 6.📝 What does <br> do? (a) makes text bold (b) makes a list (c) adds a picture (d) starts a new line
- 7.True or false: <meta charset="utf-8"> goes in the body. (a) True (b) False
-
8.🔗 Which words do you click on?
<a href="about.html">Contact us</a> (a) Visit the site (b) about.html (c) Contact us (d) href - 9.📝 Does <h1> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
-
10.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>Cricket Club</title>
</head>
<body>
<h1>Planets</h1>
<p>Here is my best one.</p>
</body>
</html> (a) index.html (b) Planets (c) Here is my best one. (d) Cricket Club - 11.🏷️ Which is the closing tag for <h2>? (a) <h2> (b) <h2/> (c) <\h2> (d) </h2>
- 12.🏷️ Is <body> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
- 13.🔠 Which heading shows the BIGGEST text: <h5>, <h4>, <h2> or <h1>? (a) <h2> (b) <h4> (c) <h5> (d) <h1>
-
14.🖼️ How many pixels wide is the picture drawn?
<img src="map.png" alt="Map of India" width="200"> - 15.🖼️ Which attribute of <img> sets how wide it is? (a) width (b) src (c) alt (d) height
- 16.🖼️ Which tag puts a picture on a page? (a) <p> (b) <pic> (c) <a> (d) <img>
- 17.🔗 Which code links to about.html? (a) <a href="about.html"> (b) <link about.html> (c) <a alt="about.html"> (d) <a src="about.html">
- 18.💬 How does an HTML comment start? (a) <!-- (b) # (c) /* (d) //
-
19.📝 On how many lines does the browser show this paragraph?
<p>Rivers flow<br>Roses are red</p> -
20.💬 How many paragraphs show on the page?
<!-- <p>I love mangoes.</p> -->
<!-- <p>Good morning!</p> -->
<!-- <p>Our school trip</p> -->
<p>My pets</p>
<!-- <p>Cricket is fun.</p> --> - 21.True or false: <li> is an unordered list. (a) False (b) True
- 22.🏷️ Is </title> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
- 23.📄 What is the first line of an HTML5 page? (a) <!DOCTYPE html> (b) <html> (c) <body> (d) <head>
- 24.💬 Can anyone read your comments by viewing the page source? (a) Yes (b) No
- 25.True or false: <table> goes in the head. (a) True (b) False
- 26.True or false: <ul> lists steps in order. (a) False (b) True
-
27.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>Class 7 Blog</title>
</head>
<body>
<h1>Easy snacks</h1>
<p>I like to read.</p>
</body>
</html> (a) Easy snacks (b) Class 7 Blog (c) index.html (d) I like to read. - 28.Which of these is true of a web server? (a) saves our .html files (b) stores a website’s files (c) turns HTML into a page (d) opens web pages for us
-
29.📋 How many items does this list show?
<ol>
<li>Guava</li>
<li>Litchi</li>
</ol> - 30.Which of these is an empty tag? (a) <hr> (b) <li> (c) <b> (d) <p>
- 31.🔢 In a basic web page file, which comes FIRST? (a) <body> (b) <!DOCTYPE html> (c) </head> (d) </html>
- 32.Which of these is a closing tag? (a) </b> (b) <body> (c) <b> (d) <h1>
- 33.🏷️ Which is the closing tag for <em>? (a) </em> (b) <em> (c) <\em> (d) <em/>
- 34.🔡 Are HTML tag names usually written in small letters? (a) Yes (b) No
-
35.📝 How many paragraphs does this code make?
<p>Fun facts</p>
<h2>Our school trip</h2>
<p>My best friend</p>
<h2>Hello, world!</h2>
<h2>Rain today</h2> - 36.True or false: <li> is an empty tag. (a) True (b) False
- 37.🔠 Which heading shows the BIGGEST text: <h1>, <h2>, <h5> or <h3>? (a) <h3> (b) <h2> (c) <h1> (d) <h5>
-
38.📋 What number does the browser show next to “Guava”?
<ol start="3">
<li>Orange</li>
<li>Jamun</li>
<li>Guava</li>
<li>Litchi</li>
</ol> - 39.Which of these is a closing tag? (a) <p> (b) <h1> (c) </li> (d) <body>
- 40.🔢 In a basic web page file, which comes first: “<!DOCTYPE html>” or “</body>”? (a) </body> (b) <!DOCTYPE html>
Answer key
- a web browser
- True
- No
- 3
- 5
- starts a new line
- False
- Contact us
- has a closing tag
- Cricket Club
- </h2>
- an opening tag
- <h1>
- 200
- width
- <img>
- <a href="about.html">
- <!--
- 2
- 1
- False
- a closing tag
- <!DOCTYPE html>
- Yes
- False
- False
- Class 7 Blog
- stores a website’s files
- 2
- <hr>
- <!DOCTYPE html>
- </b>
- </em>
- Yes
- 2
- False
- <h1>
- 5
- </li>
- <!DOCTYPE html>
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids