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 words do you click on?
<a href="contact.html">Contact us</a> (a) contact.html (b) Contact us (c) Visit the site (d) href - 2.📝 What does <hr> draw? (a) a picture (b) a line across the page (c) a table (d) a link
-
3.📝 How many paragraphs does this code make?
<p>Hello, world!</p>
<p>My best friend</p>
<p>My pets</p>
<p>Rain today</p> - 4.🔢 In a basic web page file, which comes first: “<head>” or “<!DOCTYPE html>”? (a) <head> (b) <!DOCTYPE html>
- 5.True or false: in <img>, height sets how tall it is. (a) False (b) True
- 6.📋 Which list shows the steps of a recipe best? (a) <br> (b) <ul> (c) <hr> (d) <ol>
-
7.🔍 One closing tag is missing. Which one?
<h1>Our school trip
<b>Hello, world!</b>
<i>The red kite</i> (a) </h1> (b) </small> (c) </b> (d) </i> -
8.💬 How many paragraphs show on the page?
<!-- <p>Hello, world!</p> -->
<!-- <p>My best friend</p> -->
<p>Good morning!</p>
<!-- <p>Fun facts</p> --> -
9.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="moon.png" alt="The full moon" width="50"> (a) moon.png (b) Our school bus (c) The full moon (d) width - 10.🔢 In a basic web page file, which comes FIRST? (a) </body> (b) </html> (c) <head> (d) <!DOCTYPE html>
- 11.🖼️ Which attribute of <img> describes the picture? (a) alt (b) width (c) height (d) src
- 12.📄 Can HTML on its own keep a high score? (a) Yes (b) No
- 13.🔠 Which heading shows the BIGGEST text: <h4>, <h5>, <h3> or <h2>? (a) <h5> (b) <h3> (c) <h4> (d) <h2>
- 14.Which of these goes in the body? (a) <style> (b) <title> (c) <p> (d) <link rel="stylesheet">
- 15.🏷️ Is </b> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
-
16.🔗 Which words do you click on?
<a href="news.html">Maths fun</a> (a) href (b) news.html (c) Maths fun (d) Art corner - 17.Which of these is true of a code editor? (a) stores a website’s files (b) colours code to help us (c) answers page requests (d) turns HTML into a page
-
18.📋 How many items does this list show?
<ol>
<li>Guava</li>
<li>Jamun</li>
<li>Grapes</li>
</ol> -
19.🔗 Where does this link open?
<a href="contact.html" target="_blank">Visit the site</a> (a) in the same tab (b) in a new tab - 20.🔗 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
-
21.🔠 How many headings are in this code?
<h1>Cricket is fun.</h1>
<p>Good morning!</p>
<h4>My pets</h4>
<p>The red kite</p>
<h2>Fun facts</h2> - 22.Which of these is a closing tag? (a) </body> (b) <body> (c) <h1> (d) <b>
- 23.🔠 How many heading levels does HTML have? (a) 3 (b) 10 (c) 4 (d) 6
-
24.📝 On how many lines does the browser show this paragraph?
<p>Rivers flow<br>Roses are red<br>Kites fly high<br>Birds sing<br>Sky is blue</p> - 25.📄 Where does the text of <title> appear? (a) in a big heading (b) on the browser tab (c) at the bottom (d) nowhere
- 26.📝 Does <h1> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
-
27.💬 Which text will NOT show on the page?
<p>My pets</p>
<p>I love mangoes.</p>
<!-- <p>My best friend</p> --> (a) My pets (b) My best friend (c) I love mangoes. - 28.📛 In <a href="x.html">, what is href? (a) an attribute (b) an element name (c) a closing tag (d) a comment
- 29.🖼️ Which attribute of <img> sets how tall it is? (a) width (b) src (c) alt (d) height
- 30.🏷️ Which is the closing tag for <small>? (a) <small/> (b) </small> (c) <\small> (d) <small>
-
31.💬 How many paragraphs show on the page?
<!-- <p>Hello, world!</p> -->
<p>My best friend</p>
<!-- <p>I love mangoes.</p> --> - 32.🔠 Which heading shows the BIGGEST text: <h5>, <h3>, <h6> or <h4>? (a) <h5> (b) <h3> (c) <h6> (d) <h4>
-
33.🔗 Which words do you click on?
<a href="games.html">School news</a> (a) games.html (b) Take the quiz (c) href (d) School news - 34.🏷️ Every HTML tag starts with which sign? (a) { (b) < (c) [ (d) (
- 35.🔗 Which code links to about.html? (a) <a src="about.html"> (b) <a alt="about.html"> (c) <a href="about.html"> (d) <link about.html>
- 36.🖼️ Why do we add alt text to an image? (a) to load it faster (b) to make it bigger (c) to describe the image (d) to colour it
-
37.🔗 Which address opens when you click this link?
<a href="games.html">Visit the site</a> (a) Visit the site (b) contact.html (c) about.html (d) games.html - 38.📄 What is the first line of an HTML5 page? (a) <head> (b) <html> (c) <!DOCTYPE html> (d) <body>
- 39.💬 Why do coders write comments? (a) to add colour (b) to leave notes (c) to show pictures (d) to make links
-
40.🔗 Which words do you click on?
<a href="games.html">Visit the site</a> (a) games.html (b) Maths fun (c) Visit the site (d) href
Answer key
- Contact us
- a line across the page
- 4
- <!DOCTYPE html>
- True
- <ol>
- </h1>
- 1
- The full moon
- <!DOCTYPE html>
- alt
- No
- <h2>
- <p>
- a closing tag
- Maths fun
- colours code to help us
- 3
- in a new tab
- opens it in a new tab
- 3
- </body>
- 6
- 5
- on the browser tab
- has a closing tag
- My best friend
- an attribute
- height
- </small>
- 1
- <h3>
- School news
- <
- <a href="about.html">
- to describe the image
- games.html
- <!DOCTYPE html>
- to leave notes
- Visit the site
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids