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.💬 How does an HTML comment start? (a) // (b) <!-- (c) # (d) /*
-
2.🔍 One closing tag is missing. Which one?
<em>Fun facts</em>
<p>Hello, world!</p>
<strong>Our school trip (a) </strong> (b) </em> (c) </i> (d) </p> -
3.🔠 How many headings are in this code?
<h1>My pets</h1>
<h3>My pets</h3>
<p>Rain today</p> - 4.Which of these is true of a web server? (a) shows line numbers (b) is where we type code (c) sends pages over the net (d) opens web pages for us
- 5.True or false: <b> is an empty tag. (a) False (b) True
-
6.🔗 Which words do you click on?
<a href="news.html">Take the quiz</a> (a) news.html (b) href (c) Take the quiz (d) Play games -
7.🔠 How many headings are in this code?
<h1>Our school trip</h1>
<p>My best friend</p>
<p>Rain today</p> - 8.📋 Which list shows the steps of a recipe best? (a) <br> (b) <hr> (c) <ol> (d) <ul>
-
9.💬 How many paragraphs show on the page?
<p>My best friend</p>
<!-- <p>Our school trip</p> -->
<p>My pets</p> - 10.🔗 Which code links to about.html? (a) <a src="about.html"> (b) <a href="about.html"> (c) <a alt="about.html"> (d) <link about.html>
- 11.Which of these is an opening tag? (a) <p> (b) </body> (c) </title> (d) </li>
-
12.💬 Which text will NOT show on the page?
<p>The red kite</p>
<p>My best friend</p>
<p>Cricket is fun.</p>
<!-- <p>Fun facts</p> --> (a) Cricket is fun. (b) Fun facts (c) The red kite (d) My best friend -
13.💬 Which text will NOT show on the page?
<p>Hello, world!</p>
<p>Rain today</p>
<p>Good morning!</p>
<!-- <p>My best friend</p> --> (a) Good morning! (b) Rain today (c) My best friend (d) Hello, world! - 14.🖼️ Which attribute of <img> sets how tall it is? (a) width (b) alt (c) height (d) src
- 15.🔠 Which heading shows the SMALLEST text: <h4>, <h6>, <h5> or <h1>? (a) <h6> (b) <h4> (c) <h1> (d) <h5>
-
16.🔍 Which line is missing its closing tag?
line 1: <b>The red kite
line 2: <p>I love mangoes.</p>
line 3: <h2>My pets</h2> (a) line 1 (b) line 2 (c) line 3 - 17.🧩 An opening tag + content + a closing tag together make an ___. (a) element (b) attribute (c) address (d) editor
- 18.🔤 In “HTML”, what does the M stand for? (a) Markup (b) Machine (c) Modern (d) Mouse
- 19.Which of these is true of a code editor? (a) hosts websites online (b) is where we type code (c) has an address bar (d) shows pages from the web
- 20.True or false: HTML on its own cannot make a form. (a) True (b) False
- 21.📄 Where does <title> go: in the head or in the body? (a) in the head (b) in the body
-
22.🔗 Which address opens when you click this link?
<a href="about.html">About us</a> (a) contact.html (b) https://example.com (c) About us (d) about.html - 23.🌐 Which one is where we type code? (a) a web server (b) a web browser (c) a code editor
- 24.🔠 How many <h1> headings should a page usually have? (a) 10 (b) 3 (c) 6 (d) 1
- 25.True or false: <title> goes in the head. (a) True (b) False
-
26.📋 What number does the browser show next to “Litchi”?
<ol start="3">
<li>Orange</li>
<li>Mango</li>
<li>Banana</li>
<li>Litchi</li>
<li>Guava</li>
<li>Jamun</li>
</ol> - 27.🏷️ Which is the closing tag for <h2>? (a) <h2> (b) </h2> (c) <h2/> (d) <\h2>
-
28.📋 How many items does this list show?
<ol>
<li>Grapes</li>
<li>Guava</li>
</ol> - 29.🔡 Are HTML tag names usually written in small letters? (a) Yes (b) No
- 30.🖼️ Which tag puts a picture on a page? (a) <pic> (b) <p> (c) <a> (d) <img>
-
31.🖼️ How many pixels wide is the picture drawn?
<img src="kite.png" alt="A red kite" width="150"> - 32.True or false: in <img>, width sets how wide it is. (a) True (b) False
- 33.🔠 Which heading shows the BIGGEST text: <h5>, <h3>, <h1> or <h6>? (a) <h3> (b) <h5> (c) <h1> (d) <h6>
- 34.🌐 Which one turns HTML into a page? (a) a web browser (b) a web server (c) a code editor
- 35.🏷️ What does a closing tag have that an opening tag does not? (a) a dot . (b) a hash # (c) a dollar $ (d) a slash /
- 36.True or false: HTML on its own cannot show paragraphs. (a) True (b) False
-
37.🔠 How many headings are in this code?
<h1>Rain today</h1>
<h3>Hello, world!</h3>
<h2>Fun facts</h2> - 38.📄 What is the first line of an HTML5 page? (a) <!DOCTYPE html> (b) <html> (c) <body> (d) <head>
-
39.🔗 Where does this link open?
<a href="https://example.com">Take the quiz</a> (a) in the same tab (b) in a new tab - 40.True or false: <ul> goes in the body. (a) False (b) True
Answer key
- <!--
- </strong>
- 2
- sends pages over the net
- False
- Take the quiz
- 1
- <ol>
- 2
- <a href="about.html">
- <p>
- Fun facts
- My best friend
- height
- <h6>
- line 1
- element
- Markup
- is where we type code
- False
- in the head
- about.html
- a code editor
- 1
- True
- 6
- </h2>
- 2
- Yes
- <img>
- 150
- True
- <h1>
- a web browser
- a slash /
- False
- 3
- <!DOCTYPE html>
- in the same tab
- True
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids