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.💬 Why do coders write comments? (a) to leave notes (b) to show pictures (c) to make links (d) to add colour
-
2.💬 Which text will NOT show on the page?
<!-- <p>Rain today</p> -->
<p>Hello, world!</p>
<p>My best friend</p>
<p>Cricket is fun.</p> (a) My best friend (b) Hello, world! (c) Rain today (d) Cricket is fun. -
3.🔠 How many headings are in this code?
<h1>Cricket is fun.</h1>
<h4>My pets</h4>
<h4>Good morning!</h4> - 4.True or false: <li> shows 1, 2, 3 numbers. (a) False (b) True
- 5.🔠 Which heading shows the BIGGEST text: <h1>, <h4>, <h3> or <h5>? (a) <h4> (b) <h3> (c) <h5> (d) <h1>
-
6.🔠 How many headings are in this code?
<h1>The red kite</h1>
<p>Hello, world!</p>
<p>Hello, world!</p>
<h2>Cricket is fun.</h2> -
7.🔗 Which address opens when you click this link?
<a href="maths.html">Contact us</a> (a) art.html (b) maths.html (c) Contact us (d) news.html - 8.🔠 Which heading shows the SMALLEST text: <h5>, <h2>, <h1> or <h6>? (a) <h5> (b) <h6> (c) <h1> (d) <h2>
- 9.Which of these is an empty tag? (a) <hr> (b) <h1> (c) <title> (d) <b>
-
10.🖼️ How many pixels wide is the picture drawn?
<img src="map.png" alt="Map of India" width="100"> - 11.🔍 Which is the odd one out? (a) has an address bar (b) turns HTML into a page (c) colours code to help us (d) opens web pages for us
- 12.🔍 Which is the odd one out? (a) has an address bar (b) opens web pages for us (c) shows pages from the web (d) is where we type code
- 13.📄 Where does <style> go: in the head or in the body? (a) in the head (b) in the body
- 14.🔠 Which heading shows the SMALLEST text: <h4>, <h1>, <h2> or <h6>? (a) <h1> (b) <h6> (c) <h4> (d) <h2>
- 15.🔠 Which heading shows the SMALLEST text: <h1>, <h6>, <h4> or <h2>? (a) <h2> (b) <h1> (c) <h4> (d) <h6>
- 16.🖼️ Which attribute of <img> tells which image to load? (a) src (b) alt (c) height (d) width
-
17.🔍 One closing tag is missing. Which one?
<p>Cricket is fun.</p>
<i>Rain today</i>
<u>Fun facts (a) </p> (b) </i> (c) </h1> (d) </u> - 18.True or false: in <img>, height sets how wide it is. (a) True (b) False
- 19.📛 In <a href="x.html">, what is href? (a) an element name (b) a comment (c) a closing tag (d) an attribute
- 20.Which of these goes in the body? (a) <meta charset="utf-8"> (b) <title> (c) <style> (d) <ul>
- 21.🔠 Which heading shows the SMALLEST text: <h5>, <h1>, <h3> or <h6>? (a) <h3> (b) <h6> (c) <h5> (d) <h1>
-
22.📝 On how many lines does the browser show this paragraph?
<p>Rivers flow<br>Kites fly high</p> - 23.📝 You type 5 spaces between two words in a <p>. How does the browser show them? (a) as one space (b) as a dot (c) as a new line (d) as 5 spaces
-
24.🔗 Which words do you click on?
<a href="games.html">About us</a> (a) games.html (b) href (c) About us (d) Contact us - 25.🔍 Which is the odd one out? (a) shows line numbers (b) answers page requests (c) is where we type code (d) saves our .html files
- 26.🔗 What does target="_blank" do to a link? (a) opens it in a new tab (b) makes it bold (c) hides the link (d) makes it blank
-
27.📝 How many paragraphs does this code make?
<p>My best friend</p>
<p>Cricket is fun.</p>
<p>Cricket is fun.</p> - 28.🔢 In a basic web page file, which comes LAST? (a) <!DOCTYPE html> (b) </html> (c) <head> (d) <html>
-
29.💬 Which text will NOT show on the page?
<!-- <p>Hello, world!</p> -->
<p>The red kite</p>
<p>Good morning!</p> (a) Good morning! (b) Hello, world! (c) The red kite - 30.📝 What does <p> make? (a) a link (b) a table (c) a picture (d) a paragraph
-
31.📋 Does this list show bullets or numbers?
<ul>
<li>Jamun</li>
<li>Banana</li>
<li>Mango</li>
</ul> (a) numbers (b) bullets -
32.💬 How many paragraphs show on the page?
<p>My pets</p>
<p>My best friend</p>
<!-- <p>The red kite</p> --> - 33.📋 Which list tag shows bullet points? (a) <li> (b) <ol> (c) <ul>
- 34.🖼️ Which attribute of <img> names the picture file? (a) alt (b) src (c) height (d) width
-
35.📋 How many items does this list show?
<ol>
<li>Jamun</li>
<li>Litchi</li>
</ol> - 36.🔠 Which tag is the least important heading? (a) <h1> (b) <p> (c) <h3> (d) <h6>
-
37.💬 Which text will NOT show on the page?
<p>The red kite</p>
<p>Good morning!</p>
<!-- <p>I love mangoes.</p> -->
<p>Fun facts</p> (a) Fun facts (b) The red kite (c) Good morning! (d) I love mangoes. - 38.📋 Which list tag goes inside ul or ol? (a) <li> (b) <ol> (c) <ul>
- 39.🔡 Are HTML tag names usually written in small letters? (a) Yes (b) No
- 40.🔍 Which is the odd one out? (a) answers page requests (b) sends pages over the net (c) hosts websites online (d) turns HTML into a page
Answer key
- to leave notes
- Rain today
- 3
- False
- <h1>
- 2
- maths.html
- <h6>
- <hr>
- 100
- colours code to help us
- is where we type code
- in the head
- <h6>
- <h6>
- src
- </u>
- False
- an attribute
- <ul>
- <h6>
- 2
- as one space
- About us
- answers page requests
- opens it in a new tab
- 3
- </html>
- Hello, world!
- a paragraph
- bullets
- 2
- <ul>
- src
- 2
- <h6>
- I love mangoes.
- <li>
- Yes
- turns HTML into a page
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids