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: a web browser saves our .html files. (a) True (b) False
- 2.🖼️ Which attribute of <img> names the picture file? (a) alt (b) height (c) src (d) width
-
3.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>Class 7 Blog</title>
</head>
<body>
<h1>Match report</h1>
<p>Try this poha.</p>
</body>
</html> (a) Try this poha. (b) Class 7 Blog (c) index.html (d) Match report - 4.🔠 Which heading shows the BIGGEST text: <h5>, <h4>, <h2> or <h1>? (a) <h4> (b) <h2> (c) <h1> (d) <h5>
- 5.🔠 Which heading shows the BIGGEST text: <h1>, <h2>, <h6> or <h5>? (a) <h6> (b) <h2> (c) <h5> (d) <h1>
-
6.📋 What number does the browser show next to “Grapes”?
<ol start="4">
<li>Guava</li>
<li>Mango</li>
<li>Grapes</li>
</ol> - 7.🔠 Which heading shows the BIGGEST text: <h6>, <h2>, <h1> or <h4>? (a) <h4> (b) <h1> (c) <h6> (d) <h2>
- 8.True or false: a code editor turns HTML into a page. (a) False (b) True
- 9.🏷️ Is <p> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
-
10.🖼️ Which picture file does the browser load?
<img src="map.png" alt="Map of India" width="400"> (a) dog.jpg (b) map.png (c) Map of India (d) cake.jpg - 11.Which of these is an empty tag? (a) <h1> (b) <br> (c) <title> (d) <li>
- 12.🔠 Which heading shows the BIGGEST text: <h6>, <h2>, <h1> or <h3>? (a) <h2> (b) <h3> (c) <h6> (d) <h1>
-
13.🔍 One closing tag is missing. Which one?
<i>Cricket is fun.
<p>I love mangoes.</p>
<h1>Rain today</h1> (a) </small> (b) </p> (c) </h1> (d) </i> -
14.🔍 Which line is missing its closing tag?
line 1: <strong>Cricket is fun.
line 2: <small>Our school trip</small>
line 3: <h2>Rain today</h2> (a) line 2 (b) line 3 (c) line 1 -
15.💬 Which text will NOT show on the page?
<p>My best friend</p>
<!-- <p>My pets</p> -->
<p>Good morning!</p>
<p>I love mangoes.</p> (a) My best friend (b) Good morning! (c) I love mangoes. (d) My pets -
16.🔗 Where does this link open?
<a href="games.html">Take the quiz</a> (a) in a new tab (b) in the same tab - 17.💬 Does the browser show comments on the page? (a) Yes (b) No
- 18.📝 You type 5 spaces between two words in a <p>. How does the browser show them? (a) as 5 spaces (b) as a dot (c) as one space (d) as a new line
- 19.📄 Which part holds everything you see on the page? (a) the title (b) the body (c) the doctype (d) the head
-
20.📝 How many paragraphs does this code make?
<p>Good morning!</p>
<p>My best friend</p>
<p>Fun facts</p>
<h2>Rain today</h2> - 21.🔠 Which heading shows the SMALLEST text: <h2>, <h3>, <h5> or <h1>? (a) <h2> (b) <h5> (c) <h1> (d) <h3>
- 22.📄 Where does <meta charset="utf-8"> go: in the head or in the body? (a) in the body (b) in the head
-
23.💬 How many paragraphs show on the page?
<!-- <p>Fun facts</p> -->
<!-- <p>My pets</p> -->
<p>Good morning!</p>
<!-- <p>My best friend</p> -->
<!-- <p>I love mangoes.</p> --> - 24.🔗 What does target="_blank" do to a link? (a) hides the link (b) makes it bold (c) makes it blank (d) opens it in a new tab
- 25.🏷️ HTML marks up text using ___. (a) wires (b) tags (c) keys (d) pixels
-
26.📝 On how many lines does the browser show this paragraph?
<p>Stars shine<br>Kites fly high</p> -
27.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>Class 7 Blog</title>
</head>
<body>
<h1>All about me</h1>
<p>Mars is red.</p>
</body>
</html> (a) Mars is red. (b) index.html (c) Class 7 Blog (d) All about me - 28.🔠 Which heading shows the SMALLEST text: <h2>, <h6>, <h5> or <h1>? (a) <h5> (b) <h6> (c) <h1> (d) <h2>
- 29.🔠 Which heading shows the BIGGEST text: <h4>, <h2>, <h3> or <h5>? (a) <h2> (b) <h5> (c) <h4> (d) <h3>
- 30.🖼️ Why do we add alt text to an image? (a) to load it faster (b) to make it bigger (c) to colour it (d) to describe the image
-
31.💬 Which text will NOT show on the page?
<p>The red kite</p>
<p>Cricket is fun.</p>
<!-- <p>My best friend</p> --> (a) My best friend (b) Cricket is fun. (c) The red kite -
32.💬 How many paragraphs show on the page?
<!-- <p>The red kite</p> -->
<p>My best friend</p>
<p>Hello, world!</p>
<p>Rain today</p> -
33.💬 Which text will NOT show on the page?
<p>Good morning!</p>
<!-- <p>Fun facts</p> -->
<p>My best friend</p> (a) Good morning! (b) My best friend (c) Fun facts -
34.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="fort.jpg" alt="An old fort" width="150"> (a) fort.jpg (b) A tiger asleep (c) An old fort (d) width -
35.🔗 Where does this link open?
<a href="about.html">About us</a> (a) in a new tab (b) in the same tab - 36.🌐 Which one colours code to help us? (a) a web server (b) a code editor (c) a web browser
- 37.True or false: <ol> shows bullet points. (a) False (b) True
- 38.🖼️ Which attribute of <img> is read by screen readers? (a) src (b) alt (c) height (d) width
- 39.📄 Where does the text of <title> appear? (a) at the bottom (b) nowhere (c) in a big heading (d) on the browser tab
- 40.Which of these is a closing tag? (a) </h1> (b) <li> (c) <b> (d) <p>
Answer key
- False
- src
- Class 7 Blog
- <h1>
- <h1>
- 6
- <h1>
- False
- an opening tag
- map.png
- <br>
- <h1>
- </i>
- line 1
- My pets
- in the same tab
- No
- as one space
- the body
- 3
- <h5>
- in the head
- 1
- opens it in a new tab
- tags
- 2
- Class 7 Blog
- <h6>
- <h2>
- to describe the image
- My best friend
- 3
- Fun facts
- An old fort
- in the same tab
- a code editor
- False
- alt
- on the browser tab
- </h1>
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids