← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 812 · 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.💬 Why do coders write comments? (a) to leave notes (b) to make links (c) to show pictures (d) to add colour
  2. 2.🔠 Which heading shows the SMALLEST text: <h5>, <h1>, <h4> or <h2>? (a) <h5> (b) <h1> (c) <h2> (d) <h4>
  3. 3.🔠 How many headings are in this code?
    <h1>Fun facts</h1>
    <p>Rain today</p>
    <p>The red kite</p>
    <h2>My pets</h2>
  4. 4.💬 How does an HTML comment end? (a) */ (b) >> (c) // (d) -->
  5. 5.📝 How many paragraphs does this code make?
    <p>Our school trip</p>
    <p>I love mangoes.</p>
    <p>Cricket is fun.</p>
    <p>I love mangoes.</p>
    <p>Good morning!</p>
  6. 6.📄 Can HTML on its own add pictures to a page? (a) No (b) Yes
  7. 7.📋 Which list suits a shopping list in any order? (a) <ul> (b) <br> (c) <hr> (d) <ol>
  8. 8.True or false: in <img>, src shows if the image fails. (a) True (b) False
  9. 9.📝 How many paragraphs does this code make?
    <p>I love mangoes.</p>
    <p>Cricket is fun.</p>
    <p>Good morning!</p>
    <p>I love mangoes.</p>
    <h2>I love mangoes.</h2>
    <p>Cricket is fun.</p>
  10. 10.📝 What does <br> do? (a) starts a new line (b) makes text bold (c) adds a picture (d) makes a list
  11. 11.🌐 Which one turns HTML into a page? (a) a code editor (b) a web browser (c) a web server
  12. 12.📋 How many items does this list show?
    <ol>
      <li>Guava</li>
      <li>Grapes</li>
    </ol>
  13. 13.💬 Does the browser show comments on the page? (a) Yes (b) No
  14. 14.🔡 Are HTML tag names usually written in small letters? (a) No (b) Yes
  15. 15.🔗 Which attribute holds the address of a link? (a) href (b) src (c) alt (d) id
  16. 16.💬 How many paragraphs show on the page?
    <p>My best friend</p>
    <!-- <p>My pets</p> -->
    <p>Our school trip</p>
  17. 17.📛 In <a href="x.html">, what is href? (a) a comment (b) a closing tag (c) an element name (d) an attribute
  18. 18.True or false: <table> goes in the head. (a) False (b) True
  19. 19.📋 Which list tag lists things in any order? (a) <ol> (b) <li> (c) <ul>
  20. 20.📝 On how many lines does the browser show this paragraph?
    <p>Birds sing<br>Sky is blue</p>
  21. 21.🔠 Which heading shows the BIGGEST text: <h4>, <h5>, <h3> or <h6>? (a) <h3> (b) <h4> (c) <h6> (d) <h5>
  22. 22.📄 What is the big heading shown on this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Space Facts</title>
    </head>
    <body>
      <h1>Planets</h1>
      <p>Here is my best one.</p>
    </body>
    </html>
    (a) body (b) Here is my best one. (c) Planets (d) Space Facts
  23. 23.📄 Can HTML on its own make links to pages? (a) No (b) Yes
  24. 24.💬 How many paragraphs show on the page?
    <p>Our school trip</p>
    <p>The red kite</p>
    <!-- <p>Fun facts</p> -->
  25. 25.📋 Which list tag is one item of a list? (a) <ul> (b) <ol> (c) <li>
  26. 26.True or false: <style> goes in the body. (a) False (b) True
  27. 27.🔠 Are headings shown in bold by default? (a) No (b) Yes
  28. 28.📋 What number does the browser show next to “Guava”?
    <ol start="5">
      <li>Jamun</li>
      <li>Guava</li>
      <li>Grapes</li>
    </ol>
  29. 29.🔍 Which line is missing its closing tag?
    line 1: <i>Cricket is fun.
    line 2: <small>The red kite</small>
    line 3: <em>Hello, world!</em>
    (a) line 3 (b) line 1 (c) line 2
  30. 30.📋 What number does the browser show next to “Papaya”?
    <ol>
      <li>Grapes</li>
      <li>Papaya</li>
      <li>Banana</li>
    </ol>
  31. 31.💬 How many paragraphs show on the page?
    <!-- <p>My pets</p> -->
    <!-- <p>Rain today</p> -->
    <p>The red kite</p>
    <p>My best friend</p>
    <!-- <p>Good morning!</p> -->
  32. 32.True or false: <ol> shows 1, 2, 3 numbers. (a) False (b) True
  33. 33.🔗 Where does this link open?
    <a href="contact.html">School news</a>
    (a) in a new tab (b) in the same tab
  34. 34.True or false: <ul> lists things in any order. (a) False (b) True
  35. 35.🔠 Which heading shows the BIGGEST text: <h3>, <h6>, <h1> or <h4>? (a) <h6> (b) <h1> (c) <h4> (d) <h3>
  36. 36.🌐 Which one colours code to help us? (a) a web server (b) a web browser (c) a code editor
  37. 37.💬 How many paragraphs show on the page?
    <!-- <p>Cricket is fun.</p> -->
    <!-- <p>Hello, world!</p> -->
    <!-- <p>My pets</p> -->
    <p>Good morning!</p>
  38. 38.🌐 Which one is where we type code? (a) a web browser (b) a web server (c) a code editor
  39. 39.Which of these goes in the body? (a) <meta charset="utf-8"> (b) <img> (c) <link rel="stylesheet"> (d) <title>
  40. 40.True or false: in <img>, height shows if the image fails. (a) False (b) True

Answer key

  1. to leave notes
  2. <h5>
  3. 2
  4. -->
  5. 5
  6. Yes
  7. <ul>
  8. False
  9. 5
  10. starts a new line
  11. a web browser
  12. 2
  13. No
  14. Yes
  15. href
  16. 2
  17. an attribute
  18. False
  19. <ul>
  20. 2
  21. <h3>
  22. Planets
  23. Yes
  24. 2
  25. <li>
  26. False
  27. Yes
  28. 6
  29. line 1
  30. 2
  31. 2
  32. True
  33. in the same tab
  34. True
  35. <h1>
  36. a code editor
  37. 1
  38. a code editor
  39. <img>
  40. False

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