← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 524 · 40 questions
TalentJR

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. 1.💬 How does an HTML comment start? (a) # (b) // (c) /* (d) <!--
  2. 2.Which of these is a closing tag? (a) <title> (b) </li> (c) <b> (d) <li>
  3. 3.🔠 Which heading shows the BIGGEST text: <h1>, <h6>, <h2> or <h5>? (a) <h2> (b) <h6> (c) <h1> (d) <h5>
  4. 4.True or false: <ol> is an unordered list. (a) True (b) False
  5. 5.🔍 Which line is missing its closing tag?
    line 1: <h2>I love mangoes.</h2>
    line 2: <u>My pets</u>
    line 3: <b>My best friend
    (a) line 1 (b) line 3 (c) line 2
  6. 6.🔍 Which line is missing its closing tag?
    line 1: <h3>Rain today</h3>
    line 2: <h1>Hello, world!</h1>
    line 3: <p>Cricket is fun.
    (a) line 3 (b) line 2 (c) line 1
  7. 7.🔠 How many headings are in this code?
    <h1>Hello, world!</h1>
    <h2>Rain today</h2>
    <h2>The red kite</h2>
    <h3>Hello, world!</h3>
    <h3>Cricket is fun.</h3>
  8. 8.Which of these is an empty tag? (a) <p> (b) <b> (c) <li> (d) <img>
  9. 9.📝 On how many lines does the browser show this paragraph?
    <p>Rivers flow<br>Sky is blue</p>
  10. 10.📋 Which list tag shows bullet points? (a) <ol> (b) <ul> (c) <li>
  11. 11.📋 Which list tag lists steps in order? (a) <ul> (b) <ol> (c) <li>
  12. 12.🖼️ Which picture file does the browser load?
    <img src="map.png" alt="Map of India" width="250">
    (a) map.png (b) Map of India (c) dog.jpg (d) cake.jpg
  13. 13.📝 Does <p> have a closing tag, or is it an empty tag? (a) has a closing tag (b) an empty tag
  14. 14.📄 What is the first line of an HTML5 page? (a) <!DOCTYPE html> (b) <head> (c) <body> (d) <html>
  15. 15.📝 What does <br> do? (a) starts a new line (b) adds a picture (c) makes text bold (d) makes a list
  16. 16.📋 Which list shows the steps of a recipe best? (a) <ul> (b) <ol> (c) <br> (d) <hr>
  17. 17.Which of these is true of a web browser? (a) shows line numbers (b) stores a website’s files (c) answers page requests (d) turns HTML into a page
  18. 18.Which of these goes in the head? (a) <table> (b) <h1> (c) <p> (d) <title>
  19. 19.📝 On how many lines does the browser show this paragraph?
    <p>Birds sing<br>Kites fly high<br>Sky is blue<br>Rivers flow<br>Stars shine</p>
  20. 20.📄 What is the big heading shown on 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) body (d) Class 7 Blog
  21. 21.🔗 Which address opens when you click this link?
    <a href="contact.html">Play games</a>
    (a) Play games (b) maths.html (c) https://example.com (d) contact.html
  22. 22.🔠 Which heading shows the BIGGEST text: <h6>, <h5>, <h2> or <h4>? (a) <h5> (b) <h4> (c) <h2> (d) <h6>
  23. 23.🔢 In a basic web page file, which comes first: “</body>” or “</head>”? (a) </body> (b) </head>
  24. 24.True or false: in <img>, alt names the picture file. (a) True (b) False
  25. 25.True or false: a code editor colours code to help us. (a) False (b) True
  26. 26.True or false: <table> goes in the head. (a) True (b) False
  27. 27.🏷️ Which is the closing tag for <p>? (a) <p> (b) <p/> (c) <\p> (d) </p>
  28. 28.📝 You type 5 spaces between two words in a <p>. How does the browser show them? (a) as a new line (b) as a dot (c) as 5 spaces (d) as one space
  29. 29.True or false: in <img>, src shows if the image fails. (a) False (b) True
  30. 30.💬 How many paragraphs show on the page?
    <p>Hello, world!</p>
    <!-- <p>Cricket is fun.</p> -->
    <p>My pets</p>
    <p>Fun facts</p>
  31. 31.🖼️ Does <img> need a closing tag? (a) No (b) Yes
  32. 32.🔠 Which heading shows the BIGGEST text: <h1>, <h6>, <h3> or <h2>? (a) <h3> (b) <h6> (c) <h1> (d) <h2>
  33. 33.📝 On how many lines does the browser show this paragraph?
    <p>Sky is blue<br>Roses are red</p>
  34. 34.🔗 Which words do you click on?
    <a href="news.html">Play games</a>
    (a) About us (b) news.html (c) href (d) Play games
  35. 35.💬 Which text will NOT show on the page?
    <!-- <p>Good morning!</p> -->
    <p>Hello, world!</p>
    <p>Cricket is fun.</p>
    <p>My pets</p>
    (a) Good morning! (b) My pets (c) Cricket is fun. (d) Hello, world!
  36. 36.🔍 Which line is missing its closing tag?
    line 1: <p>Hello, world!</p>
    line 2: <u>My best friend</u>
    line 3: <i>My pets
    (a) line 2 (b) line 1 (c) line 3
  37. 37.🔠 Which heading shows the SMALLEST text: <h5>, <h3>, <h2> or <h4>? (a) <h3> (b) <h2> (c) <h5> (d) <h4>
  38. 38.📝 How many paragraphs does this code make?
    <p>My best friend</p>
    <p>The red kite</p>
    <p>Hello, world!</p>
  39. 39.🔠 Which heading shows the SMALLEST text: <h1>, <h2>, <h3> or <h5>? (a) <h2> (b) <h5> (c) <h3> (d) <h1>
  40. 40.🔍 One closing tag is missing. Which one?
    <h1>Hello, world!</h1>
    <p>The red kite
    <h3>Our school trip</h3>
    (a) </h3> (b) </h2> (c) </p> (d) </h1>

Answer key

  1. <!--
  2. </li>
  3. <h1>
  4. False
  5. line 3
  6. line 3
  7. 5
  8. <img>
  9. 2
  10. <ul>
  11. <ol>
  12. map.png
  13. has a closing tag
  14. <!DOCTYPE html>
  15. starts a new line
  16. <ol>
  17. turns HTML into a page
  18. <title>
  19. 5
  20. All about me
  21. contact.html
  22. <h2>
  23. </head>
  24. False
  25. True
  26. False
  27. </p>
  28. as one space
  29. False
  30. 3
  31. No
  32. <h1>
  33. 2
  34. Play games
  35. Good morning!
  36. line 3
  37. <h5>
  38. 3
  39. <h5>
  40. </p>

Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids