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.True or false: <meta charset="utf-8"> goes in the body. (a) True (b) False
- 2.🔗 Which attribute holds the address of a link? (a) src (b) href (c) id (d) alt
- 3.📛 In <a href="x.html">, what is href? (a) an element name (b) a closing tag (c) a comment (d) an attribute
- 4.📄 Can HTML on its own make a form? (a) Yes (b) No
- 5.🏷️ Which is the closing tag for <strong>? (a) <\strong> (b) <strong/> (c) <strong> (d) </strong>
-
6.📝 On how many lines does the browser show this paragraph?
<p>Stars shine<br>Sky is blue</p> - 7.📄 Can HTML on its own show paragraphs? (a) No (b) Yes
- 8.Which of these goes in the body? (a) <link rel="stylesheet"> (b) <title> (c) <meta charset="utf-8"> (d) <a>
- 9.True or false: in <img>, alt shows if the image fails. (a) False (b) True
- 10.Which of these is an empty tag? (a) <b> (b) <img> (c) <ul> (d) <li>
-
11.🔠 How many headings are in this code?
<h1>Rain today</h1>
<p>Our school trip</p>
<h3>Cricket is fun.</h3>
<p>I love mangoes.</p>
<h4>Good morning!</h4> - 12.💬 How does an HTML comment end? (a) // (b) */ (c) >> (d) -->
- 13.Which of these is true of a web server? (a) opens web pages for us (b) hosts websites online (c) saves our .html files (d) shows line numbers
-
14.💬 How many paragraphs show on the page?
<!-- <p>Cricket is fun.</p> -->
<p>My pets</p>
<!-- <p>Fun facts</p> --> - 15.🌐 Which one has an address bar? (a) a web server (b) a code editor (c) a web browser
- 16.Which of these is an opening tag? (a) </title> (b) <h1> (c) </p> (d) </li>
- 17.🖼️ Which attribute of <img> sets how wide it is? (a) alt (b) width (c) height (d) src
- 18.🧱 HTML gives a web page its ___. (a) sound (b) speed (c) structure (d) colours
-
19.💬 Which text will NOT show on the page?
<!-- <p>Rain today</p> -->
<p>I love mangoes.</p>
<p>Fun facts</p>
<p>Our school trip</p> (a) I love mangoes. (b) Fun facts (c) Rain today (d) Our school trip -
20.🔠 How many headings are in this code?
<h1>I love mangoes.</h1>
<h2>The red kite</h2>
<p>Rain today</p>
<h4>Hello, world!</h4>
<h2>The red kite</h2> - 21.🖼️ Does <img> need a closing tag? (a) No (b) Yes
- 22.Which of these is an empty tag? (a) <li> (b) <b> (c) <hr> (d) <h1>
- 23.🏷️ Which is the closing tag for <u>? (a) <u/> (b) <u> (c) <\u> (d) </u>
-
24.📋 What number does the browser show next to “Orange”?
<ol>
<li>Jamun</li>
<li>Grapes</li>
<li>Orange</li>
</ol> -
25.🔠 How many headings are in this code?
<h1>Hello, world!</h1>
<h3>Cricket is fun.</h3>
<p>My pets</p> -
26.🔗 Where does this link open?
<a href="games.html" target="_blank">Play games</a> (a) in a new tab (b) in the same tab - 27.🔠 How many <h1> headings should a page usually have? (a) 6 (b) 3 (c) 10 (d) 1
- 28.🔠 Which heading shows the SMALLEST text: <h4>, <h2>, <h5> or <h6>? (a) <h5> (b) <h4> (c) <h6> (d) <h2>
- 29.📋 Which list tag lists steps in order? (a) <ul> (b) <ol> (c) <li>
-
30.🖼️ How many pixels wide is the picture drawn?
<img src="moon.png" alt="The full moon" width="350"> -
31.🖼️ How many pixels wide is the picture drawn?
<img src="tiger.jpg" alt="A tiger asleep" width="300"> - 32.True or false: in <img>, src tells which image to load. (a) False (b) True
-
33.🔠 How many headings are in this code?
<h1>Our school trip</h1>
<h4>The red kite</h4>
<p>I love mangoes.</p>
<p>Fun facts</p>
<h2>Fun facts</h2> -
34.🔍 Which line is missing its closing tag?
line 1: <b>The red kite</b>
line 2: <u>I love mangoes.</u>
line 3: <small>My best friend (a) line 1 (b) line 3 (c) line 2 -
35.🔗 Which words do you click on?
<a href="contact.html">Play games</a> (a) contact.html (b) About us (c) Play games (d) href - 36.Which of these is true of a web browser? (a) hosts websites online (b) is where we type code (c) stores a website’s files (d) shows pages from the web
- 37.🔗 Which tag makes a clickable link? (a) <link> (b) <img> (c) <p> (d) <a>
- 38.🔠 Which heading shows the SMALLEST text: <h1>, <h4>, <h3> or <h2>? (a) <h2> (b) <h4> (c) <h3> (d) <h1>
- 39.💬 How does an HTML comment start? (a) // (b) /* (c) <!-- (d) #
-
40.🔍 One closing tag is missing. Which one?
<h2>Hello, world!</h2>
<u>The red kite
<h3>Our school trip</h3> (a) </h1> (b) </u> (c) </h2> (d) </h3>
Answer key
- False
- href
- an attribute
- Yes
- </strong>
- 2
- Yes
- <a>
- True
- <img>
- 3
- -->
- hosts websites online
- 1
- a web browser
- <h1>
- width
- structure
- Rain today
- 4
- No
- <hr>
- </u>
- 3
- 2
- in a new tab
- 1
- <h6>
- <ol>
- 350
- 300
- True
- 3
- line 3
- Play games
- shows pages from the web
- <a>
- <h4>
- <!--
- </u>
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids