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>My best friend</h1>
<h2>The red kite</h2>
<p>Fun facts</p>
<h3>Cricket is fun.</h3> - 2.🔗 Which code links to about.html? (a) <a href="about.html"> (b) <link about.html> (c) <a alt="about.html"> (d) <a src="about.html">
- 3.📝 What does <br> do? (a) adds a picture (b) makes text bold (c) makes a list (d) starts a new line
- 4.📄 Where does <h1> go: in the head or in the body? (a) in the head (b) in the body
-
5.🖼️ How many pixels wide is the picture drawn?
<img src="bus.jpg" alt="Our school bus" width="200"> - 6.🔗 What does target="_blank" do to a link? (a) hides the link (b) opens it in a new tab (c) makes it bold (d) makes it blank
- 7.🏷️ Is <body> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
- 8.📝 You type 5 spaces between two words in a <p>. How does the browser show them? (a) as a new line (b) as a dot (c) as 5 spaces (d) as one space
- 9.🖼️ Which attribute of <img> tells which image to load? (a) width (b) alt (c) src (d) height
-
10.💬 Which text will NOT show on the page?
<!-- <p>My best friend</p> -->
<p>Cricket is fun.</p>
<p>Good morning!</p> (a) Good morning! (b) Cricket is fun. (c) My best friend - 11.🏷️ Which is the closing tag for <h2>? (a) <\h2> (b) <h2/> (c) </h2> (d) <h2>
-
12.🔗 Where does this link open?
<a href="maths.html" target="_blank">Art corner</a> (a) in a new tab (b) in the same tab -
13.🖼️ How many pixels wide is the picture drawn?
<img src="map.png" alt="Map of India" width="50"> -
14.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Riya’s Recipes</title>
</head>
<body>
<h1>Easy snacks</h1>
<p>I like to read.</p>
</body>
</html> (a) body (b) I like to read. (c) Riya’s Recipes (d) Easy snacks - 15.💬 How does an HTML comment end? (a) >> (b) --> (c) // (d) */
- 16.True or false: <table> goes in the body. (a) False (b) True
-
17.🔗 Which words do you click on?
<a href="about.html">About us</a> (a) href (b) About us (c) Contact us (d) about.html - 18.📝 What do we need to write HTML? (a) a printer (b) a microphone (c) a plain text editor (d) a paintbrush
- 19.🔠 How many heading levels does HTML have? (a) 10 (b) 6 (c) 4 (d) 3
-
20.🔍 One closing tag is missing. Which one?
<h1>Fun facts
<u>My pets</u>
<em>My best friend</em> (a) </h1> (b) </em> (c) </u> (d) </h3> -
21.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="tiger.jpg" alt="A tiger asleep" width="200"> (a) tiger.jpg (b) A red kite (c) A tiger asleep (d) width - 22.🌐 Which one colours code to help us? (a) a code editor (b) a web server (c) a web browser
- 23.True or false: a web server saves our .html files. (a) False (b) True
- 24.Which of these is a closing tag? (a) <li> (b) </title> (c) <p> (d) <b>
- 25.Which of these is true of a code editor? (a) is where we type code (b) has an address bar (c) stores a website’s files (d) shows pages from the web
- 26.💬 Why do coders write comments? (a) to leave notes (b) to add colour (c) to show pictures (d) to make links
- 27.🖼️ Does <img> need a closing tag? (a) No (b) Yes
- 28.🔠 Which tag is used for the main title on a page? (a) <h1> (b) <h6> (c) <br> (d) <p>
-
29.💬 Which text will NOT show on the page?
<p>Cricket is fun.</p>
<p>Hello, world!</p>
<!-- <p>The red kite</p> -->
<p>Rain today</p> (a) Cricket is fun. (b) Hello, world! (c) Rain today (d) The red kite -
30.💬 Which text will NOT show on the page?
<!-- <p>Good morning!</p> -->
<p>Our school trip</p>
<p>The red kite</p>
<p>Rain today</p> (a) Good morning! (b) Rain today (c) Our school trip (d) The red kite -
31.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="tiger.jpg" alt="A tiger asleep" width="300"> (a) width (b) A red kite (c) tiger.jpg (d) A tiger asleep - 32.Which of these has a closing tag? (a) <img> (b) <br> (c) <hr> (d) <h1>
- 33.🔢 In a basic web page file, which comes first: “</html>” or “<!DOCTYPE html>”? (a) </html> (b) <!DOCTYPE html>
- 34.🔠 Which heading shows the BIGGEST text: <h4>, <h1>, <h3> or <h6>? (a) <h6> (b) <h4> (c) <h3> (d) <h1>
- 35.📄 Can HTML on its own run a game loop? (a) Yes (b) No
- 36.📋 Which list shows the steps of a recipe best? (a) <hr> (b) <br> (c) <ul> (d) <ol>
- 37.True or false: in <img>, width describes the picture. (a) True (b) False
- 38.Which of these is an empty tag? (a) <li> (b) <h1> (c) <ul> (d) <hr>
- 39.🏷️ Which is the closing tag for <u>? (a) <u/> (b) <u> (c) </u> (d) <\u>
- 40.True or false: <input> is an empty tag. (a) True (b) False
Answer key
- 3
- <a href="about.html">
- starts a new line
- in the body
- 200
- opens it in a new tab
- an opening tag
- as one space
- src
- My best friend
- </h2>
- in a new tab
- 50
- Easy snacks
- -->
- True
- About us
- a plain text editor
- 6
- </h1>
- A tiger asleep
- a code editor
- False
- </title>
- is where we type code
- to leave notes
- No
- <h1>
- The red kite
- Good morning!
- A tiger asleep
- <h1>
- <!DOCTYPE html>
- <h1>
- No
- <ol>
- False
- <hr>
- </u>
- True
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids