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="maths.html">About us</a> (a) Contact us (b) maths.html (c) href (d) About us - 2.🌐 Which one is where we type code? (a) a code editor (b) a web server (c) a web browser
- 3.🏷️ Is </p> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
-
4.🔗 Which words do you click on?
<a href="art.html">Play games</a> (a) href (b) art.html (c) About us (d) Play games - 5.Which of these is true of a code editor? (a) shows line numbers (b) opens web pages for us (c) shows pages from the web (d) turns HTML into a page
- 6.🔠 How many heading levels does HTML have? (a) 4 (b) 3 (c) 10 (d) 6
- 7.📋 Which list tag shows 1, 2, 3 numbers? (a) <ul> (b) <ol> (c) <li>
- 8.🔠 How many <h1> headings should a page usually have? (a) 3 (b) 6 (c) 1 (d) 10
- 9.True or false: a web server is where we type code. (a) True (b) False
-
10.📝 How many paragraphs does this code make?
<p>My best friend</p>
<p>My pets</p>
<p>Cricket is fun.</p>
<h2>My pets</h2> -
11.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="kite.png" alt="A red kite" width="50"> (a) Map of India (b) kite.png (c) width (d) A red kite -
12.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>My Hobbies</title>
</head>
<body>
<h1>Planets</h1>
<p>Try this poha.</p>
</body>
</html> (a) Try this poha. (b) Planets (c) My Hobbies (d) index.html -
13.📋 How many items does this list show?
<ol>
<li>Mango</li>
<li>Guava</li>
<li>Jamun</li>
</ol> - 14.🔠 Which heading shows the SMALLEST text: <h4>, <h3>, <h5> or <h2>? (a) <h4> (b) <h5> (c) <h3> (d) <h2>
- 15.True or false: <p> is an empty tag. (a) False (b) True
-
16.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="fort.jpg" alt="An old fort" width="100"> (a) An old fort (b) fort.jpg (c) A tiger asleep (d) width - 17.🖼️ Which attribute of <img> shows if the image fails? (a) src (b) alt (c) width (d) height
-
18.📝 How many paragraphs does this code make?
<p>I love mangoes.</p>
<p>Good morning!</p>
<h2>Cricket is fun.</h2> - 19.📄 Where does <table> go: in the head or in the body? (a) in the head (b) in the body
- 20.🖼️ Which tag puts a picture on a page? (a) <img> (b) <a> (c) <pic> (d) <p>
- 21.Which of these has a closing tag? (a) <meta> (b) <hr> (c) <img> (d) <ul>
- 22.📝 Does <br> have a closing tag, or is it an empty tag? (a) has a closing tag (b) an empty tag
-
23.🔗 Where does this link open?
<a href="contact.html">Maths fun</a> (a) in a new tab (b) in the same tab - 24.📄 Where does the text of <title> appear? (a) at the bottom (b) nowhere (c) on the browser tab (d) in a big heading
- 25.True or false: HTML on its own can run a game loop. (a) False (b) True
-
26.📋 How many items does this list show?
<ol>
<li>Grapes</li>
<li>Banana</li>
<li>Litchi</li>
<li>Mango</li>
</ol> - 27.🖼️ Which attribute of <img> names the picture file? (a) height (b) width (c) alt (d) src
- 28.🖼️ Which attribute of <img> sets how tall it is? (a) height (b) width (c) alt (d) src
- 29.🔗 What does target="_blank" do to a link? (a) hides the link (b) makes it blank (c) opens it in a new tab (d) makes it bold
-
30.🔠 How many headings are in this code?
<h1>Rain today</h1>
<p>I love mangoes.</p>
<h4>Rain today</h4> - 31.Which of these is true of a code editor? (a) turns HTML into a page (b) colours code to help us (c) hosts websites online (d) sends pages over the net
- 32.🔢 In a basic web page file, which comes first: “<html>” or “<!DOCTYPE html>”? (a) <html> (b) <!DOCTYPE html>
- 33.📄 Where does <img> go: in the head or in the body? (a) in the body (b) in the head
- 34.🖼️ Does <img> need a closing tag? (a) No (b) Yes
- 35.🖼️ 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
-
36.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>Art Gallery</title>
</head>
<body>
<h1>Planets</h1>
<p>Thanks for visiting.</p>
</body>
</html> (a) index.html (b) Art Gallery (c) Planets (d) Thanks for visiting. - 37.📄 Where does <title> go: in the head or in the body? (a) in the body (b) in the head
-
38.🔗 Which words do you click on?
<a href="quiz.html">Maths fun</a> (a) href (b) Art corner (c) Maths fun (d) quiz.html - 39.Which of these goes in the body? (a) <link rel="stylesheet"> (b) <meta charset="utf-8"> (c) <style> (d) <a>
- 40.📛 In <a href="x.html">, what is href? (a) a comment (b) a closing tag (c) an element name (d) an attribute
Answer key
- About us
- a code editor
- a closing tag
- Play games
- shows line numbers
- 6
- <ol>
- 1
- False
- 3
- A red kite
- My Hobbies
- 3
- <h5>
- False
- An old fort
- alt
- 2
- in the body
- <img>
- <ul>
- an empty tag
- in the same tab
- on the browser tab
- False
- 4
- src
- height
- opens it in a new tab
- 2
- colours code to help us
- <!DOCTYPE html>
- in the body
- No
- to describe the image
- Art Gallery
- in the head
- Maths fun
- <a>
- an attribute
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids