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: in <img>, width shows if the image fails. (a) True (b) False
- 2.📄 Where does <p> go: in the head or in the body? (a) in the body (b) in the head
- 3.📝 What does <p> make? (a) a table (b) a link (c) a paragraph (d) a picture
-
4.💬 How many paragraphs show on the page?
<p>Hello, world!</p>
<!-- <p>Good morning!</p> -->
<p>The red kite</p> - 5.🖼️ Which tag puts a picture on a page? (a) <p> (b) <img> (c) <a> (d) <pic>
- 6.🖼️ Which attribute of <img> sets how wide it is? (a) src (b) height (c) width (d) alt
-
7.📝 On how many lines does the browser show this paragraph?
<p>Birds sing<br>Rivers flow<br>Roses are red<br>Stars shine</p> - 8.🔗 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
-
9.💬 How many paragraphs show on the page?
<!-- <p>My pets</p> -->
<p>My best friend</p>
<p>Fun facts</p> -
10.🔠 How many headings are in this code?
<h1>The red kite</h1>
<h3>Our school trip</h3>
<p>Fun facts</p>
<p>My pets</p>
<h2>The red kite</h2> - 11.📋 Which list shows the steps of a recipe best? (a) <hr> (b) <ol> (c) <ul> (d) <br>
- 12.Which of these is a closing tag? (a) <b> (b) </li> (c) <body> (d) <h1>
-
13.🔗 Where does this link open?
<a href="quiz.html" target="_blank">About us</a> (a) in a new tab (b) in the same tab - 14.💬 How does an HTML comment start? (a) # (b) /* (c) // (d) <!--
- 15.🧩 An opening tag + content + a closing tag together make an ___. (a) editor (b) address (c) element (d) attribute
- 16.🔠 Which heading shows the SMALLEST text: <h1>, <h4>, <h5> or <h3>? (a) <h4> (b) <h5> (c) <h3> (d) <h1>
-
17.📝 How many paragraphs does this code make?
<p>My best friend</p>
<p>I love mangoes.</p>
<p>Cricket is fun.</p> -
18.🔠 How many headings are in this code?
<h1>The red kite</h1>
<h4>My best friend</h4>
<h2>I love mangoes.</h2>
<h2>My pets</h2>
<p>Our school trip</p> - 19.📋 Which list tag shows bullet points? (a) <ul> (b) <li> (c) <ol>
- 20.Which of these goes in the head? (a) <title> (b) <a> (c) <p> (d) <h1>
- 21.True or false: HTML on its own can make tables. (a) True (b) False
- 22.📄 Where does <link rel="stylesheet"> go: in the head or in the body? (a) in the head (b) in the body
-
23.📄 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) Try this poha. (b) index.html (c) My Hobbies (d) Welcome! - 24.🔗 Which attribute holds the address of a link? (a) src (b) alt (c) id (d) href
- 25.📄 What is the first line of an HTML5 page? (a) <body> (b) <html> (c) <!DOCTYPE html> (d) <head>
- 26.Which of these goes in the head? (a) <a> (b) <table> (c) <img> (d) <link rel="stylesheet">
-
27.🔍 One closing tag is missing. Which one?
<u>Our school trip
<h1>My best friend</h1>
<i>I love mangoes.</i> (a) </p> (b) </u> (c) </i> (d) </h1> - 28.💬 Why do coders write comments? (a) to show pictures (b) to add colour (c) to make links (d) to leave notes
- 29.Which of these is an opening tag? (a) <b> (b) </body> (c) </p> (d) </h1>
-
30.📋 Does this list show bullets or numbers?
<ul>
<li>Guava</li>
<li>Jamun</li>
</ul> (a) bullets (b) numbers - 31.📝 You type 5 spaces between two words in a <p>. How does the browser show them? (a) as one space (b) as a new line (c) as a dot (d) as 5 spaces
-
32.🔍 Which line is missing its closing tag?
line 1: <p>Hello, world!
line 2: <h1>Fun facts</h1>
line 3: <h3>Good morning!</h3> (a) line 3 (b) line 2 (c) line 1 -
33.📝 On how many lines does the browser show this paragraph?
<p>Sky is blue<br>Roses are red<br>Rivers flow</p> -
34.🔗 Which address opens when you click this link?
<a href="news.html">Contact us</a> (a) Contact us (b) games.html (c) news.html (d) quiz.html - 35.True or false: a web server sends pages over the net. (a) False (b) True
- 36.Which of these is true of a web server? (a) saves our .html files (b) answers page requests (c) turns HTML into a page (d) shows pages from the web
- 37.💾 A web page file usually ends with which extension? (a) .html (b) .png (c) .txt (d) .mp3
-
38.🔍 One closing tag is missing. Which one?
<strong>My pets</strong>
<em>I love mangoes.
<h2>Good morning!</h2> (a) </small> (b) </strong> (c) </em> (d) </h2> - 39.📄 Where does <ul> go: in the head or in the body? (a) in the head (b) in the body
-
40.🔠 How many headings are in this code?
<h1>Cricket is fun.</h1>
<p>Our school trip</p>
<p>Hello, world!</p>
<p>My pets</p>
<p>The red kite</p>
Answer key
- False
- in the body
- a paragraph
- 2
- <img>
- width
- 4
- opens it in a new tab
- 2
- 3
- <ol>
- </li>
- in a new tab
- <!--
- element
- <h5>
- 3
- 4
- <ul>
- <title>
- True
- in the head
- My Hobbies
- href
- <!DOCTYPE html>
- <link rel="stylesheet">
- </u>
- to leave notes
- <b>
- bullets
- as one space
- line 1
- 3
- news.html
- True
- answers page requests
- .html
- </em>
- in the body
- 1
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids