← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 279 · 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 many items does this list show?
    <ol>
      <li>Mango</li>
      <li>Banana</li>
    </ol>
  2. 2.🔍 Which line is missing its closing tag?
    line 1: <h1>The red kite</h1>
    line 2: <h2>Rain today</h2>
    line 3: <h3>Our school trip
    (a) line 3 (b) line 1 (c) line 2
  3. 3.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="tiger.jpg" alt="A tiger asleep" width="150">
    (a) tiger.jpg (b) width (c) A tiger asleep (d) A red kite
  4. 4.📋 What number does the browser show next to “Guava”?
    <ol>
      <li>Litchi</li>
      <li>Grapes</li>
      <li>Jamun</li>
      <li>Mango</li>
      <li>Guava</li>
    </ol>
  5. 5.🔠 How many heading levels does HTML have? (a) 4 (b) 3 (c) 10 (d) 6
  6. 6.Which of these is an empty tag? (a) <li> (b) <p> (c) <ul> (d) <img>
  7. 7.🔍 Which line is missing its closing tag?
    line 1: <h2>Cricket is fun.</h2>
    line 2: <h3>Good morning!</h3>
    line 3: <h1>I love mangoes.
    (a) line 1 (b) line 2 (c) line 3
  8. 8.🔗 Where does this link open?
    <a href="games.html" target="_blank">Maths fun</a>
    (a) in the same tab (b) in a new tab
  9. 9.📄 Which part holds everything you see on the page? (a) the doctype (b) the title (c) the head (d) the body
  10. 10.🔗 Which words do you click on?
    <a href="https://example.com">Contact us</a>
    (a) Contact us (b) Visit the site (c) https://example.com (d) href
  11. 11.📋 Which list shows the steps of a recipe best? (a) <hr> (b) <br> (c) <ul> (d) <ol>
  12. 12.Which of these is true of a web browser? (a) saves our .html files (b) colours code to help us (c) opens web pages for us (d) is where we type code
  13. 13.Which of these goes in the head? (a) <ul> (b) <title> (c) <p> (d) <h1>
  14. 14.🔠 How many headings are in this code?
    <h1>Our school trip</h1>
    <h4>My pets</h4>
    <h2>Our school trip</h2>
    <p>Fun facts</p>
  15. 15.🔍 Which is the odd one out? (a) turns HTML into a page (b) shows pages from the web (c) has an address bar (d) is where we type code
  16. 16.🏷️ Which is the closing tag for <p>? (a) <p/> (b) <\p> (c) <p> (d) </p>
  17. 17.🔢 In a basic web page file, which comes LAST? (a) </html> (b) <!DOCTYPE html> (c) </head> (d) <head>
  18. 18.💬 Which text will NOT show on the page?
    <p>Good morning!</p>
    <p>My best friend</p>
    <!-- <p>Fun facts</p> -->
    (a) My best friend (b) Fun facts (c) Good morning!
  19. 19.💬 How many paragraphs show on the page?
    <!-- <p>Rain today</p> -->
    <p>I love mangoes.</p>
    <!-- <p>Good morning!</p> -->
    <!-- <p>The red kite</p> -->
  20. 20.True or false: in <img>, src sets how wide it is. (a) False (b) True
  21. 21.🔠 Which heading shows the SMALLEST text: <h6>, <h1>, <h5> or <h2>? (a) <h2> (b) <h5> (c) <h1> (d) <h6>
  22. 22.🖼️ Does <img> need a closing tag? (a) Yes (b) No
  23. 23.🖼️ How many pixels wide is the picture drawn?
    <img src="dog.jpg" alt="A happy dog" width="50">
  24. 24.📝 You type 5 spaces between two words in a <p>. How does the browser show them? (a) as 5 spaces (b) as a new line (c) as a dot (d) as one space
  25. 25.🔍 Which line is missing its closing tag?
    line 1: <em>Our school trip
    line 2: <h1>My pets</h1>
    line 3: <strong>Cricket is fun.</strong>
    (a) line 2 (b) line 3 (c) line 1
  26. 26.📋 How many items does this list show?
    <ul>
      <li>Litchi</li>
      <li>Banana</li>
    </ul>
  27. 27.🔠 How many headings are in this code?
    <h1>The red kite</h1>
    <p>The red kite</p>
    <h4>My pets</h4>
  28. 28.📄 What is the first line of an HTML5 page? (a) <!DOCTYPE html> (b) <body> (c) <html> (d) <head>
  29. 29.💬 How many paragraphs show on the page?
    <p>Hello, world!</p>
    <p>My best friend</p>
    <!-- <p>Our school trip</p> -->
  30. 30.Which of these has a closing tag? (a) <br> (b) <hr> (c) <meta> (d) <title>
  31. 31.🔍 Which line is missing its closing tag?
    line 1: <i>Our school trip</i>
    line 2: <h2>Good morning!</h2>
    line 3: <h1>Rain today
    (a) line 1 (b) line 3 (c) line 2
  32. 32.📄 What is the big heading shown on this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Space Facts</title>
    </head>
    <body>
      <h1>All about me</h1>
      <p>Mars is red.</p>
    </body>
    </html>
    (a) body (b) Space Facts (c) Mars is red. (d) All about me
  33. 33.🏷️ What does a closing tag have that an opening tag does not? (a) a dollar $ (b) a dot . (c) a hash # (d) a slash /
  34. 34.🖼️ How many pixels wide is the picture drawn?
    <img src="moon.png" alt="The full moon" width="50">
  35. 35.🔗 Where does this link open?
    <a href="games.html" target="_blank">School news</a>
    (a) in the same tab (b) in a new tab
  36. 36.🔗 What does target="_blank" do to a link? (a) opens it in a new tab (b) makes it bold (c) makes it blank (d) hides the link
  37. 37.📋 Does this list show bullets or numbers?
    <ul>
      <li>Grapes</li>
      <li>Mango</li>
    </ul>
    (a) bullets (b) numbers
  38. 38.🔠 Which heading shows the BIGGEST text: <h5>, <h6>, <h3> or <h1>? (a) <h6> (b) <h5> (c) <h1> (d) <h3>
  39. 39.🔢 In a basic web page file, which comes first: “<!DOCTYPE html>” or “<head>”? (a) <head> (b) <!DOCTYPE html>
  40. 40.🔗 Which address opens when you click this link?
    <a href="contact.html">Contact us</a>
    (a) maths.html (b) contact.html (c) Contact us (d) https://example.com

Answer key

  1. 2
  2. line 3
  3. A tiger asleep
  4. 5
  5. 6
  6. <img>
  7. line 3
  8. in a new tab
  9. the body
  10. Contact us
  11. <ol>
  12. opens web pages for us
  13. <title>
  14. 3
  15. is where we type code
  16. </p>
  17. </html>
  18. Fun facts
  19. 1
  20. False
  21. <h6>
  22. No
  23. 50
  24. as one space
  25. line 1
  26. 2
  27. 2
  28. <!DOCTYPE html>
  29. 2
  30. <title>
  31. line 3
  32. All about me
  33. a slash /
  34. 50
  35. in a new tab
  36. opens it in a new tab
  37. bullets
  38. <h1>
  39. <!DOCTYPE html>
  40. contact.html

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