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 many headings are in this code?
<h1>Our school trip</h1>
<h3>The red kite</h3>
<h4>My best friend</h4>
<h4>I love mangoes.</h4>
<p>Hello, world!</p> - 2.📄 Which part holds everything you see on the page? (a) the head (b) the body (c) the doctype (d) the title
- 3.🖼️ Which attribute of <img> names the picture file? (a) height (b) width (c) alt (d) src
- 4.📋 Which tag goes around each item of a list? (a) <ol> (b) <ul> (c) <li> (d) <p>
- 5.True or false: <input> is an empty tag. (a) False (b) True
-
6.💬 How many paragraphs show on the page?
<p>Our school trip</p>
<!-- <p>Hello, world!</p> -->
<p>Cricket is fun.</p>
<!-- <p>Rain today</p> -->
<!-- <p>Good morning!</p> --> - 7.📋 Which list tag lists steps in order? (a) <li> (b) <ul> (c) <ol>
-
8.🔍 Which line is missing its closing tag?
line 1: <h1>My pets
line 2: <p>My best friend</p>
line 3: <h2>Fun facts</h2> (a) line 3 (b) line 1 (c) line 2 - 9.Which of these goes in the head? (a) <h1> (b) <p> (c) <ul> (d) <title>
-
10.📋 What number does the browser show next to “Grapes”?
<ol>
<li>Banana</li>
<li>Guava</li>
<li>Grapes</li>
<li>Papaya</li>
<li>Litchi</li>
</ol> - 11.Which of these is a closing tag? (a) </body> (b) <b> (c) <title> (d) <li>
- 12.🖼️ Which tag puts a picture on a page? (a) <a> (b) <p> (c) <img> (d) <pic>
- 13.💬 Can anyone read your comments by viewing the page source? (a) No (b) Yes
-
14.🔗 Which words do you click on?
<a href="news.html">Maths fun</a> (a) href (b) Art corner (c) news.html (d) Maths fun - 15.🔠 Which heading shows the SMALLEST text: <h2>, <h1>, <h4> or <h6>? (a) <h1> (b) <h4> (c) <h2> (d) <h6>
- 16.True or false: in <img>, alt sets how wide it is. (a) True (b) False
-
17.💬 How many paragraphs show on the page?
<p>My pets</p>
<!-- <p>Cricket is fun.</p> -->
<p>Our school trip</p>
<!-- <p>Rain today</p> --> - 18.Which of these has a closing tag? (a) <input> (b) <li> (c) <hr> (d) <meta>
- 19.🌐 Which one sends pages over the net? (a) a code editor (b) a web server (c) a web browser
- 20.📄 Where does the text of <title> appear? (a) in a big heading (b) on the browser tab (c) nowhere (d) at the bottom
- 21.🏷️ Which is the closing tag for <p>? (a) <p> (b) <\p> (c) <p/> (d) </p>
- 22.Which of these has a closing tag? (a) <hr> (b) <br> (c) <b> (d) <img>
- 23.🔠 How many <h1> headings should a page usually have? (a) 1 (b) 3 (c) 10 (d) 6
- 24.📄 Can HTML on its own make headings? (a) Yes (b) No
- 25.🔠 Which tag is used for the main title on a page? (a) <h6> (b) <p> (c) <h1> (d) <br>
- 26.🔠 How many heading levels does HTML have? (a) 6 (b) 4 (c) 10 (d) 3
- 27.🖼️ Which attribute of <img> shows if the image fails? (a) width (b) height (c) src (d) alt
- 28.🌐 Which one answers page requests? (a) a web browser (b) a web server (c) a code editor
-
29.🔍 One closing tag is missing. Which one?
<small>Our school trip</small>
<u>Fun facts</u>
<strong>I love mangoes. (a) </b> (b) </strong> (c) </small> (d) </u> - 30.🏷️ Which is the closing tag for <h3>? (a) </h3> (b) <\h3> (c) <h3> (d) <h3/>
- 31.📋 Which list tag lists things in any order? (a) <ol> (b) <ul> (c) <li>
- 32.Which of these has a closing tag? (a) <input> (b) <img> (c) <ul> (d) <meta>
- 33.True or false: <meta charset="utf-8"> goes in the head. (a) False (b) True
-
34.📋 Does this list show bullets or numbers?
<ol>
<li>Guava</li>
<li>Jamun</li>
</ol> (a) bullets (b) numbers -
35.🔗 Where does this link open?
<a href="news.html" target="_blank">Visit the site</a> (a) in the same tab (b) in a new tab - 36.💬 How does an HTML comment end? (a) >> (b) // (c) --> (d) */
- 37.🏷️ Is <body> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
- 38.🔠 Which heading shows the BIGGEST text: <h5>, <h2>, <h3> or <h1>? (a) <h5> (b) <h1> (c) <h2> (d) <h3>
- 39.🔠 Which heading shows the BIGGEST text: <h5>, <h2>, <h3> or <h6>? (a) <h5> (b) <h3> (c) <h2> (d) <h6>
- 40.🔠 Which heading shows the SMALLEST text: <h4>, <h5>, <h6> or <h1>? (a) <h4> (b) <h6> (c) <h5> (d) <h1>
Answer key
- 4
- the body
- src
- <li>
- True
- 2
- <ol>
- line 1
- <title>
- 3
- </body>
- <img>
- Yes
- Maths fun
- <h6>
- False
- 2
- <li>
- a web server
- on the browser tab
- </p>
- <b>
- 1
- Yes
- <h1>
- 6
- alt
- a web server
- </strong>
- </h3>
- <ul>
- <ul>
- True
- numbers
- in a new tab
- -->
- an opening tag
- <h1>
- <h2>
- <h6>
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids