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 of these goes in the head? (a) <img> (b) <title> (c) <ul> (d) <p>
- 2.📄 What is the first line of an HTML5 page? (a) <body> (b) <html> (c) <head> (d) <!DOCTYPE html>
- 3.🔡 Are HTML tag names usually written in small letters? (a) Yes (b) No
-
4.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>My Hobbies</title>
</head>
<body>
<h1>Welcome!</h1>
<p>Try this poha.</p>
</body>
</html> (a) Welcome! (b) Try this poha. (c) index.html (d) My Hobbies - 5.🔠 Which heading shows the SMALLEST text: <h1>, <h6>, <h2> or <h3>? (a) <h3> (b) <h1> (c) <h6> (d) <h2>
- 6.🔢 In a basic web page file, which comes first: “</head>” or “<html>”? (a) <html> (b) </head>
-
7.🔍 One closing tag is missing. Which one?
<strong>Fun facts
<h1>The red kite</h1>
<em>Rain today</em> (a) </h1> (b) </em> (c) </h2> (d) </strong> - 8.🏷️ What does a closing tag have that an opening tag does not? (a) a dollar $ (b) a hash # (c) a slash / (d) a dot .
- 9.📛 In <a href="x.html">, what is href? (a) a closing tag (b) an attribute (c) a comment (d) an element name
-
10.📝 On how many lines does the browser show this paragraph?
<p>Rivers flow<br>Roses are red<br>Stars shine<br>Kites fly high<br>Birds sing</p> - 11.Which of these goes in the body? (a) <meta charset="utf-8"> (b) <table> (c) <link rel="stylesheet"> (d) <style>
- 12.📄 Where does <link rel="stylesheet"> go: in the head or in the body? (a) in the head (b) in the body
-
13.📋 How many items does this list show?
<ol>
<li>Orange</li>
<li>Banana</li>
<li>Jamun</li>
</ol> -
14.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="dog.jpg" alt="A happy dog" width="200"> (a) dog.jpg (b) The full moon (c) A happy dog (d) width - 15.Which of these has a closing tag? (a) <br> (b) <hr> (c) <img> (d) <title>
- 16.💬 How does an HTML comment end? (a) // (b) */ (c) >> (d) -->
-
17.💬 Which text will NOT show on the page?
<p>Our school trip</p>
<p>Fun facts</p>
<!-- <p>My pets</p> --> (a) Fun facts (b) My pets (c) Our school trip -
18.🔗 Which words do you click on?
<a href="about.html">School news</a> (a) href (b) School news (c) Take the quiz (d) about.html - 19.💬 Why do coders write comments? (a) to make links (b) to add colour (c) to show pictures (d) to leave notes
-
20.🖼️ Which picture file does the browser load?
<img src="tiger.jpg" alt="A tiger asleep" width="400"> (a) kite.png (b) tiger.jpg (c) map.png (d) A tiger asleep - 21.🌐 Which one shows line numbers? (a) a web server (b) a code editor (c) a web browser
- 22.📝 Does <p> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
- 23.📄 Where does <table> go: in the head or in the body? (a) in the body (b) in the head
- 24.🖼️ Which attribute of <img> shows if the image fails? (a) alt (b) height (c) width (d) src
- 25.📄 Where does <p> go: in the head or in the body? (a) in the head (b) in the body
-
26.🖼️ Which picture file does the browser load?
<img src="map.png" alt="Map of India" width="150"> (a) cake.jpg (b) map.png (c) Map of India (d) dog.jpg -
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) All about me (b) Mars is red. (c) Class 7 Blog (d) index.html - 28.True or false: in <img>, alt names the picture file. (a) False (b) True
- 29.🔗 What does target="_blank" do to a link? (a) makes it bold (b) hides the link (c) opens it in a new tab (d) makes it blank
- 30.📋 Which list tag shows 1, 2, 3 numbers? (a) <li> (b) <ol> (c) <ul>
- 31.🔗 Which tag makes a clickable link? (a) <a> (b) <p> (c) <link> (d) <img>
-
32.🖼️ How many pixels wide is the picture drawn?
<img src="moon.png" alt="The full moon" width="250"> -
33.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Cricket Club</title>
</head>
<body>
<h1>All about me</h1>
<p>Mars is red.</p>
</body>
</html> (a) Mars is red. (b) Cricket Club (c) All about me (d) body -
34.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Art Gallery</title>
</head>
<body>
<h1>Welcome!</h1>
<p>Here is my best one.</p>
</body>
</html> (a) Welcome! (b) Here is my best one. (c) Art Gallery (d) body - 35.Which of these is true of a web server? (a) turns HTML into a page (b) hosts websites online (c) saves our .html files (d) shows pages from the web
- 36.🖼️ Which attribute of <img> sets how wide it is? (a) src (b) alt (c) width (d) height
- 37.🔠 Which tag is the least important heading? (a) <h3> (b) <h6> (c) <h1> (d) <p>
-
38.📋 Does this list show bullets or numbers?
<ul>
<li>Mango</li>
<li>Banana</li>
<li>Orange</li>
</ul> (a) numbers (b) bullets - 39.🔗 Which code links to about.html? (a) <link about.html> (b) <a href="about.html"> (c) <a alt="about.html"> (d) <a src="about.html">
- 40.True or false: <input> has a closing tag. (a) True (b) False
Answer key
- <title>
- <!DOCTYPE html>
- Yes
- My Hobbies
- <h6>
- <html>
- </strong>
- a slash /
- an attribute
- 5
- <table>
- in the head
- 3
- A happy dog
- <title>
- -->
- My pets
- School news
- to leave notes
- tiger.jpg
- a code editor
- has a closing tag
- in the body
- alt
- in the body
- map.png
- Class 7 Blog
- False
- opens it in a new tab
- <ol>
- <a>
- 250
- All about me
- Welcome!
- hosts websites online
- width
- <h6>
- bullets
- <a href="about.html">
- False
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids