← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 985 · 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.🖼️ 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) A red kite (c) width (d) A tiger asleep
  2. 2.🔠 How many headings are in this code?
    <h1>Hello, world!</h1>
    <h4>My pets</h4>
    <h4>My pets</h4>
    <h2>Hello, world!</h2>
    <h2>Fun facts</h2>
  3. 3.Which of these is an opening tag? (a) <body> (b) </title> (c) </b> (d) </p>
  4. 4.True or false: HTML on its own can pick a random number. (a) False (b) True
  5. 5.🖼️ Why do we add alt text to an image? (a) to describe the image (b) to make it bigger (c) to colour it (d) to load it faster
  6. 6.📄 What is the big heading shown on this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Space Facts</title>
    </head>
    <body>
      <h1>Welcome!</h1>
      <p>Here is my best one.</p>
    </body>
    </html>
    (a) Here is my best one. (b) body (c) Welcome! (d) Space Facts
  7. 7.🔠 How many headings are in this code?
    <h1>My pets</h1>
    <p>Hello, world!</p>
    <h2>My pets</h2>
    <p>Rain today</p>
  8. 8.💬 How many paragraphs show on the page?
    <!-- <p>Cricket is fun.</p> -->
    <p>Good morning!</p>
    <p>Rain today</p>
  9. 9.🔗 Which attribute holds the address of a link? (a) alt (b) id (c) href (d) src
  10. 10.📝 Does <meta> have a closing tag, or is it an empty tag? (a) has a closing tag (b) an empty tag
  11. 11.🖼️ Does <img> need a closing tag? (a) No (b) Yes
  12. 12.🔗 Which words do you click on?
    <a href="about.html">Play games</a>
    (a) About us (b) href (c) Play games (d) about.html
  13. 13.📄 Where does <table> go: in the head or in the body? (a) in the body (b) in the head
  14. 14.💾 A web page file usually ends with which extension? (a) .png (b) .txt (c) .mp3 (d) .html
  15. 15.True or false: a web browser saves our .html files. (a) True (b) False
  16. 16.🏷️ Which is the closing tag for <u>? (a) <u> (b) <\u> (c) </u> (d) <u/>
  17. 17.🔍 One closing tag is missing. Which one?
    <u>The red kite
    <h3>Rain today</h3>
    <h2>Cricket is fun.</h2>
    (a) </h1> (b) </h2> (c) </h3> (d) </u>
  18. 18.🖼️ Which picture file does the browser load?
    <img src="dog.jpg" alt="A happy dog" width="300">
    (a) dog.jpg (b) moon.png (c) bus.jpg (d) A happy dog
  19. 19.True or false: <input> has a closing tag. (a) True (b) False
  20. 20.🔠 Which tag is the least important heading? (a) <h6> (b) <h1> (c) <h3> (d) <p>
  21. 21.🔍 One closing tag is missing. Which one?
    <i>I love mangoes.</i>
    <strong>Rain today</strong>
    <h3>Good morning!
    (a) </i> (b) </strong> (c) </h3> (d) </h2>
  22. 22.📋 What number does the browser show next to “Litchi”?
    <ol start="8">
      <li>Jamun</li>
      <li>Papaya</li>
      <li>Litchi</li>
      <li>Orange</li>
      <li>Grapes</li>
    </ol>
  23. 23.📋 Does this list show bullets or numbers?
    <ul>
      <li>Grapes</li>
      <li>Mango</li>
      <li>Jamun</li>
    </ul>
    (a) numbers (b) bullets
  24. 24.🏷️ Is </li> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
  25. 25.📝 Does <hr> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
  26. 26.📄 Which part holds everything you see on the page? (a) the head (b) the doctype (c) the title (d) the body
  27. 27.📋 How many items does this list show?
    <ul>
      <li>Guava</li>
      <li>Orange</li>
      <li>Papaya</li>
      <li>Mango</li>
    </ul>
  28. 28.🔗 Which words do you click on?
    <a href="contact.html">Contact us</a>
    (a) Visit the site (b) contact.html (c) href (d) Contact us
  29. 29.🔢 In a basic web page file, which comes FIRST? (a) <head> (b) </head> (c) <!DOCTYPE html> (d) <html>
  30. 30.True or false: in <img>, src names the picture file. (a) False (b) True
  31. 31.📝 How many paragraphs does this code make?
    <p>I love mangoes.</p>
    <p>I love mangoes.</p>
    <p>Rain today</p>
  32. 32.💬 How does an HTML comment start? (a) <!-- (b) // (c) /* (d) #
  33. 33.🔡 Are HTML tag names usually written in small letters? (a) No (b) Yes
  34. 34.💬 How many paragraphs show on the page?
    <!-- <p>Cricket is fun.</p> -->
    <!-- <p>Hello, world!</p> -->
    <!-- <p>The red kite</p> -->
    <p>Rain today</p>
  35. 35.True or false: <li> goes inside ul or ol. (a) False (b) True
  36. 36.📋 Which list shows the steps of a recipe best? (a) <ol> (b) <br> (c) <ul> (d) <hr>
  37. 37.🔍 Which line is missing its closing tag?
    line 1: <h2>Hello, world!</h2>
    line 2: <h3>My pets</h3>
    line 3: <p>Cricket is fun.
    (a) line 2 (b) line 1 (c) line 3
  38. 38.True or false: <table> goes in the body. (a) True (b) False
  39. 39.True or false: <li> shows bullet points. (a) True (b) False
  40. 40.🔠 Which heading shows the BIGGEST text: <h1>, <h6>, <h4> or <h3>? (a) <h1> (b) <h3> (c) <h4> (d) <h6>

Answer key

  1. A tiger asleep
  2. 5
  3. <body>
  4. False
  5. to describe the image
  6. Welcome!
  7. 2
  8. 2
  9. href
  10. an empty tag
  11. No
  12. Play games
  13. in the body
  14. .html
  15. False
  16. </u>
  17. </u>
  18. dog.jpg
  19. False
  20. <h6>
  21. </h3>
  22. 10
  23. bullets
  24. a closing tag
  25. an empty tag
  26. the body
  27. 4
  28. Contact us
  29. <!DOCTYPE html>
  30. True
  31. 3
  32. <!--
  33. Yes
  34. 1
  35. True
  36. <ol>
  37. line 3
  38. True
  39. False
  40. <h1>

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