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.🖼️ Which attribute of <img> shows if the image fails? (a) width (b) height (c) src (d) alt
- 2.📄 What is the first line of an HTML5 page? (a) <body> (b) <html> (c) <!DOCTYPE html> (d) <head>
- 3.📄 Can HTML on its own add up two numbers? (a) No (b) Yes
- 4.📝 What does <p> make? (a) a link (b) a paragraph (c) a picture (d) a table
-
5.📋 Does this list show bullets or numbers?
<ul>
<li>Litchi</li>
<li>Guava</li>
</ul> (a) bullets (b) numbers - 6.True or false: <ol> lists things in any order. (a) True (b) False
- 7.🔠 Which heading shows the SMALLEST text: <h5>, <h4>, <h3> or <h1>? (a) <h5> (b) <h1> (c) <h3> (d) <h4>
-
8.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="kite.png" alt="A red kite" width="300"> (a) width (b) Map of India (c) A red kite (d) kite.png -
9.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="tiger.jpg" alt="A tiger asleep" width="100"> (a) A red kite (b) tiger.jpg (c) A tiger asleep (d) width - 10.True or false: <li> shows bullet points. (a) True (b) False
-
11.🔗 Where does this link open?
<a href="about.html" target="_blank">Take the quiz</a> (a) in the same tab (b) in a new tab - 12.📝 Does <title> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
- 13.🔠 Which heading shows the BIGGEST text: <h1>, <h5>, <h3> or <h2>? (a) <h2> (b) <h3> (c) <h1> (d) <h5>
- 14.📋 Which list suits a shopping list in any order? (a) <br> (b) <ul> (c) <ol> (d) <hr>
-
15.🔗 Which words do you click on?
<a href="contact.html">School news</a> (a) Take the quiz (b) contact.html (c) School news (d) href - 16.📄 Where does the text of <title> appear? (a) nowhere (b) on the browser tab (c) in a big heading (d) at the bottom
- 17.🔠 Which heading shows the SMALLEST text: <h4>, <h1>, <h6> or <h3>? (a) <h6> (b) <h1> (c) <h3> (d) <h4>
- 18.💬 Can anyone read your comments by viewing the page source? (a) No (b) Yes
-
19.🔗 Which words do you click on?
<a href="about.html">Visit the site</a> (a) Maths fun (b) about.html (c) href (d) Visit the site - 20.📄 Where does <title> go: in the head or in the body? (a) in the body (b) in the head
-
21.🔍 One closing tag is missing. Which one?
<b>Good morning!</b>
<i>Rain today</i>
<strong>My best friend (a) </strong> (b) </i> (c) </small> (d) </b> - 22.📋 Which list tag goes inside ul or ol? (a) <li> (b) <ul> (c) <ol>
- 23.📄 Where does <link rel="stylesheet"> go: in the head or in the body? (a) in the body (b) in the head
- 24.🌐 Which one colours code to help us? (a) a web server (b) a code editor (c) a web browser
-
25.🔠 How many headings are in this code?
<h1>The red kite</h1>
<p>Rain today</p>
<p>The red kite</p>
<p>The red kite</p>
<h3>Fun facts</h3> - 26.📋 Which list tag shows 1, 2, 3 numbers? (a) <ol> (b) <li> (c) <ul>
- 27.🌐 Which one answers page requests? (a) a web browser (b) a web server (c) a code editor
- 28.💬 Why do coders write comments? (a) to add colour (b) to leave notes (c) to make links (d) to show pictures
-
29.💬 Which text will NOT show on the page?
<!-- <p>My best friend</p> -->
<p>Hello, world!</p>
<p>The red kite</p>
<p>Good morning!</p> (a) Good morning! (b) Hello, world! (c) My best friend (d) The red kite - 30.📋 Which list tag shows bullet points? (a) <li> (b) <ol> (c) <ul>
-
31.🖼️ How many pixels wide is the picture drawn?
<img src="cake.jpg" alt="Birthday cake" width="150"> - 32.True or false: <a> goes in the body. (a) False (b) True
-
33.💬 Which text will NOT show on the page?
<p>My pets</p>
<p>The red kite</p>
<p>Hello, world!</p>
<!-- <p>My best friend</p> --> (a) My pets (b) The red kite (c) My best friend (d) Hello, world! - 34.True or false: <li> shows 1, 2, 3 numbers. (a) True (b) False
-
35.🔍 Which line is missing its closing tag?
line 1: <small>Our school trip</small>
line 2: <h3>Rain today
line 3: <h2>The red kite</h2> (a) line 3 (b) line 1 (c) line 2 - 36.🔗 What does target="_blank" do to a link? (a) hides the link (b) makes it blank (c) makes it bold (d) opens it in a new tab
- 37.📄 Can HTML on its own count button clicks? (a) Yes (b) No
- 38.🖼️ Which tag puts a picture on a page? (a) <a> (b) <img> (c) <pic> (d) <p>
- 39.🔠 Which tag is the least important heading? (a) <h6> (b) <h3> (c) <h1> (d) <p>
-
40.🔍 One closing tag is missing. Which one?
<b>Good morning!
<i>The red kite</i>
<strong>Fun facts</strong> (a) </strong> (b) </b> (c) </h2> (d) </i>
Answer key
- alt
- <!DOCTYPE html>
- No
- a paragraph
- bullets
- False
- <h5>
- A red kite
- A tiger asleep
- False
- in a new tab
- has a closing tag
- <h1>
- <ul>
- School news
- on the browser tab
- <h6>
- Yes
- Visit the site
- in the head
- </strong>
- <li>
- in the head
- a code editor
- 2
- <ol>
- a web server
- to leave notes
- My best friend
- <ul>
- 150
- True
- My best friend
- False
- line 2
- opens it in a new tab
- No
- <img>
- <h6>
- </b>
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids