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: in <img>, height shows if the image fails. (a) True (b) False
-
2.💬 Which text will NOT show on the page?
<p>Hello, world!</p>
<p>Fun facts</p>
<!-- <p>Rain today</p> -->
<p>My best friend</p> (a) Fun facts (b) Hello, world! (c) Rain today (d) My best friend - 3.True or false: <input> has a closing tag. (a) True (b) False
- 4.🔗 Which attribute holds the address of a link? (a) src (b) href (c) alt (d) id
- 5.True or false: in <img>, src tells which image to load. (a) False (b) True
- 6.🔠 Which heading shows the SMALLEST text: <h2>, <h4>, <h6> or <h5>? (a) <h6> (b) <h4> (c) <h2> (d) <h5>
- 7.🔠 Which heading shows the BIGGEST text: <h3>, <h4>, <h1> or <h2>? (a) <h3> (b) <h1> (c) <h4> (d) <h2>
- 8.📄 Can HTML on its own make a form? (a) No (b) Yes
-
9.🖼️ How many pixels wide is the picture drawn?
<img src="fort.jpg" alt="An old fort" width="100"> - 10.Which of these is true of a web server? (a) sends pages over the net (b) opens web pages for us (c) shows pages from the web (d) colours code to help us
- 11.📝 What does <hr> draw? (a) a line across the page (b) a link (c) a table (d) a picture
- 12.📄 Can HTML on its own make bullet lists? (a) No (b) Yes
- 13.True or false: a web browser saves our .html files. (a) True (b) False
-
14.🔗 Which words do you click on?
<a href="maths.html">Maths fun</a> (a) maths.html (b) Art corner (c) href (d) Maths fun -
15.🔠 How many headings are in this code?
<h1>Our school trip</h1>
<p>Rain today</p>
<h3>Rain today</h3> - 16.🔢 In a basic web page file, which comes FIRST? (a) <head> (b) </html> (c) <body> (d) <!DOCTYPE html>
- 17.🔤 In “HTML”, what do the letters HT stand for? (a) Home Text (b) HyperText (c) High Tech (d) Hot Tags
-
18.🔠 How many headings are in this code?
<h1>Our school trip</h1>
<p>My pets</p>
<h4>My best friend</h4> - 19.🏷️ Is <body> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
- 20.True or false: in <img>, alt is read by screen readers. (a) True (b) False
-
21.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>Art Gallery</title>
</head>
<body>
<h1>Planets</h1>
<p>Here is my best one.</p>
</body>
</html> (a) index.html (b) Art Gallery (c) Here is my best one. (d) Planets - 22.🔠 How many heading levels does HTML have? (a) 6 (b) 3 (c) 4 (d) 10
- 23.📄 Where does <title> go: in the head or in the body? (a) in the head (b) in the body
- 24.📄 Where does the text of <title> appear? (a) nowhere (b) at the bottom (c) in a big heading (d) on the browser tab
- 25.🖼️ Which attribute of <img> describes the picture? (a) src (b) width (c) alt (d) height
- 26.🖼️ Why do we add alt text to an image? (a) to colour it (b) to describe the image (c) to load it faster (d) to make it bigger
-
27.📝 On how many lines does the browser show this paragraph?
<p>Birds sing<br>Kites fly high</p> -
28.🖼️ Which picture file does the browser load?
<img src="cake.jpg" alt="Birthday cake" width="250"> (a) cake.jpg (b) moon.png (c) dog.jpg (d) Birthday cake - 29.True or false: <img> has a closing tag. (a) False (b) True
-
30.🔠 How many headings are in this code?
<h1>My best friend</h1>
<h4>Good morning!</h4>
<h4>I love mangoes.</h4> - 31.📄 Where does <style> go: in the head or in the body? (a) in the body (b) in the head
- 32.Which of these is true of a code editor? (a) turns HTML into a page (b) opens web pages for us (c) colours code to help us (d) has an address bar
- 33.🔠 Which heading shows the SMALLEST text: <h5>, <h6>, <h2> or <h4>? (a) <h2> (b) <h4> (c) <h6> (d) <h5>
-
34.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>Cricket Club</title>
</head>
<body>
<h1>My drawings</h1>
<p>Mars is red.</p>
</body>
</html> (a) Mars is red. (b) index.html (c) Cricket Club (d) My drawings - 35.True or false: in <img>, height sets how tall it is. (a) True (b) False
- 36.📋 Which list tag shows bullet points? (a) <ol> (b) <ul> (c) <li>
- 37.📄 What is the first line of an HTML5 page? (a) <!DOCTYPE html> (b) <head> (c) <body> (d) <html>
-
38.💬 How many paragraphs show on the page?
<p>My best friend</p>
<p>Hello, world!</p>
<p>Good morning!</p>
<!-- <p>Rain today</p> --> - 39.🖼️ Which attribute of <img> shows if the image fails? (a) src (b) width (c) height (d) alt
- 40.🔠 Which heading shows the BIGGEST text: <h4>, <h5>, <h2> or <h3>? (a) <h4> (b) <h2> (c) <h5> (d) <h3>
Answer key
- False
- Rain today
- False
- href
- True
- <h6>
- <h1>
- Yes
- 100
- sends pages over the net
- a line across the page
- Yes
- False
- Maths fun
- 2
- <!DOCTYPE html>
- HyperText
- 2
- an opening tag
- True
- Art Gallery
- 6
- in the head
- on the browser tab
- alt
- to describe the image
- 2
- cake.jpg
- False
- 3
- in the head
- colours code to help us
- <h6>
- Cricket Club
- True
- <ul>
- <!DOCTYPE html>
- 3
- alt
- <h2>
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids