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.🔍 One closing tag is missing. Which one?
<i>My best friend
<p>Cricket is fun.</p>
<small>I love mangoes.</small> (a) </p> (b) </small> (c) </i> (d) </strong> - 2.🔗 Which tag makes a clickable link? (a) <a> (b) <img> (c) <link> (d) <p>
- 3.🔗 Which attribute holds the address of a link? (a) src (b) alt (c) id (d) href
- 4.🔢 In a basic web page file, which comes first: “<head>” or “</body>”? (a) <head> (b) </body>
- 5.🔢 In a basic web page file, which comes LAST? (a) <body> (b) </head> (c) </html> (d) <!DOCTYPE html>
-
6.🔠 How many headings are in this code?
<h1>My pets</h1>
<p>Good morning!</p>
<p>Good morning!</p>
<p>My best friend</p> - 7.True or false: in <img>, alt sets how wide it is. (a) True (b) False
-
8.🖼️ Which picture file does the browser load?
<img src="moon.png" alt="The full moon" width="250"> (a) fort.jpg (b) moon.png (c) bus.jpg (d) The full moon -
9.📝 How many paragraphs does this code make?
<p>I love mangoes.</p>
<p>Cricket is fun.</p>
<h2>Hello, world!</h2>
<h2>Hello, world!</h2> - 10.Which of these is true of a web browser? (a) shows line numbers (b) hosts websites online (c) turns HTML into a page (d) saves our .html files
-
11.📝 On how many lines does the browser show this paragraph?
<p>Stars shine<br>Birds sing<br>Sky is blue<br>Roses are red<br>Kites fly high</p> -
12.💬 Which text will NOT show on the page?
<!-- <p>My pets</p> -->
<p>The red kite</p>
<p>Our school trip</p> (a) Our school trip (b) My pets (c) The red kite -
13.📝 On how many lines does the browser show this paragraph?
<p>Birds sing<br>Kites fly high<br>Stars shine<br>Roses are red</p> - 14.📝 What does <hr> draw? (a) a link (b) a table (c) a line across the page (d) a picture
-
15.🔍 One closing tag is missing. Which one?
<em>Rain today
<h2>Hello, world!</h2>
<h1>Cricket is fun.</h1> (a) </b> (b) </h1> (c) </em> (d) </h2> - 16.📄 Can HTML on its own add pictures to a page? (a) Yes (b) No
- 17.🔠 Are headings shown in bold by default? (a) No (b) Yes
- 18.📋 Which list tag lists things in any order? (a) <li> (b) <ul> (c) <ol>
-
19.📋 How many items does this list show?
<ul>
<li>Grapes</li>
<li>Litchi</li>
</ul> - 20.🔗 What does target="_blank" do to a link? (a) opens it in a new tab (b) makes it bold (c) hides the link (d) makes it blank
-
21.📝 On how many lines does the browser show this paragraph?
<p>Sky is blue<br>Stars shine<br>Roses are red<br>Birds sing</p> - 22.🖼️ Which attribute of <img> sets how wide it is? (a) alt (b) src (c) height (d) width
-
23.🔗 Where does this link open?
<a href="maths.html" target="_blank">School news</a> (a) in the same tab (b) in a new tab - 24.📄 Can HTML on its own run a game loop? (a) Yes (b) No
-
25.🔗 Where does this link open?
<a href="maths.html">Contact us</a> (a) in the same tab (b) in a new tab -
26.🔍 One closing tag is missing. Which one?
<p>My best friend</p>
<h2>Fun facts
<em>Our school trip</em> (a) </em> (b) </h2> (c) </h1> (d) </p> - 27.True or false: <style> goes in the head. (a) True (b) False
- 28.Which of these has a closing tag? (a) <img> (b) <h1> (c) <br> (d) <meta>
- 29.💬 Does the browser show comments on the page? (a) No (b) Yes
- 30.🔠 How many heading levels does HTML have? (a) 10 (b) 6 (c) 4 (d) 3
- 31.🔠 Which heading shows the SMALLEST text: <h6>, <h1>, <h5> or <h4>? (a) <h1> (b) <h5> (c) <h4> (d) <h6>
- 32.📝 Does <hr> have a closing tag, or is it an empty tag? (a) has a closing tag (b) an empty tag
-
33.🔗 Where does this link open?
<a href="quiz.html">Art corner</a> (a) in a new tab (b) in the same tab -
34.🔗 Which address opens when you click this link?
<a href="contact.html">School news</a> (a) https://example.com (b) maths.html (c) School news (d) contact.html - 35.🖼️ Which attribute of <img> sets how tall it is? (a) alt (b) height (c) width (d) src
- 36.🔗 Which code links to about.html? (a) <link about.html> (b) <a href="about.html"> (c) <a src="about.html"> (d) <a alt="about.html">
- 37.📋 Which list suits a shopping list in any order? (a) <hr> (b) <br> (c) <ul> (d) <ol>
- 38.💬 Can anyone read your comments by viewing the page source? (a) Yes (b) No
- 39.True or false: <ul> lists things in any order. (a) False (b) True
-
40.💬 How many paragraphs show on the page?
<p>My pets</p>
<p>The red kite</p>
<p>My best friend</p>
<!-- <p>I love mangoes.</p> -->
<p>Rain today</p>
Answer key
- </i>
- <a>
- href
- <head>
- </html>
- 1
- False
- moon.png
- 2
- turns HTML into a page
- 5
- My pets
- 4
- a line across the page
- </em>
- Yes
- Yes
- <ul>
- 2
- opens it in a new tab
- 4
- width
- in a new tab
- No
- in the same tab
- </h2>
- True
- <h1>
- No
- 6
- <h6>
- an empty tag
- in the same tab
- contact.html
- height
- <a href="about.html">
- <ul>
- Yes
- True
- 4
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids