← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 542 · 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 words do you click on?
    <a href="contact.html">Play games</a>
    (a) About us (b) contact.html (c) Play games (d) href
  3. 3.📋 Which list shows the steps of a recipe best? (a) <hr> (b) <ol> (c) <br> (d) <ul>
  4. 4.📄 What does the browser tab show for this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Class 7 Blog</title>
    </head>
    <body>
      <h1>Easy snacks</h1>
      <p>Mars is red.</p>
    </body>
    </html>
    (a) Mars is red. (b) Class 7 Blog (c) Easy snacks (d) index.html
  5. 5.🔠 How many headings are in this code?
    <h1>My pets</h1>
    <p>Cricket is fun.</p>
    <h2>Good morning!</h2>
    <p>Fun facts</p>
    <p>I love mangoes.</p>
  6. 6.📄 What does the browser tab show for this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Class 7 Blog</title>
    </head>
    <body>
      <h1>Match report</h1>
      <p>Mars is red.</p>
    </body>
    </html>
    (a) Class 7 Blog (b) index.html (c) Match report (d) Mars is red.
  7. 7.📋 What number does the browser show next to “Papaya”?
    <ol>
      <li>Orange</li>
      <li>Litchi</li>
      <li>Papaya</li>
      <li>Jamun</li>
    </ol>
  8. 8.💬 How many paragraphs show on the page?
    <!-- <p>Hello, world!</p> -->
    <!-- <p>I love mangoes.</p> -->
    <p>My best friend</p>
  9. 9.True or false: in <img>, src sets how wide it is. (a) True (b) False
  10. 10.📋 Does this list show bullets or numbers?
    <ul>
      <li>Papaya</li>
      <li>Litchi</li>
    </ul>
    (a) numbers (b) bullets
  11. 11.🖼️ Does <img> need a closing tag? (a) No (b) Yes
  12. 12.True or false: a web server hosts websites online. (a) False (b) True
  13. 13.🏷️ Is <h1> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
  14. 14.🖼️ Which attribute of <img> sets how wide it is? (a) height (b) src (c) width (d) alt
  15. 15.📄 Can HTML on its own add pictures to a page? (a) Yes (b) No
  16. 16.🖼️ Which attribute of <img> names the picture file? (a) width (b) src (c) height (d) alt
  17. 17.🔗 Where does this link open?
    <a href="contact.html" target="_blank">Take the quiz</a>
    (a) in a new tab (b) in the same tab
  18. 18.🔗 Which address opens when you click this link?
    <a href="quiz.html">School news</a>
    (a) games.html (b) quiz.html (c) School news (d) about.html
  19. 19.True or false: in <img>, src tells which image to load. (a) True (b) False
  20. 20.🔗 What does target="_blank" do to a link? (a) makes it bold (b) makes it blank (c) opens it in a new tab (d) hides the link
  21. 21.📄 What does the browser tab show for this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>My Hobbies</title>
    </head>
    <body>
      <h1>Welcome!</h1>
      <p>Here is my best one.</p>
    </body>
    </html>
    (a) index.html (b) Here is my best one. (c) My Hobbies (d) Welcome!
  22. 22.🔗 Which attribute holds the address of a link? (a) alt (b) id (c) src (d) href
  23. 23.💬 Does the browser show comments on the page? (a) Yes (b) No
  24. 24.🖼️ Which picture file does the browser load?
    <img src="tiger.jpg" alt="A tiger asleep" width="200">
    (a) tiger.jpg (b) map.png (c) A tiger asleep (d) kite.png
  25. 25.True or false: HTML on its own can make a form. (a) True (b) False
  26. 26.Which of these is true of a code editor? (a) shows line numbers (b) turns HTML into a page (c) opens web pages for us (d) answers page requests
  27. 27.📄 Where does <table> go: in the head or in the body? (a) in the body (b) in the head
  28. 28.Which of these is a closing tag? (a) <body> (b) <b> (c) </b> (d) <li>
  29. 29.🔍 Which is the odd one out? (a) hosts websites online (b) shows line numbers (c) answers page requests (d) sends pages over the net
  30. 30.📋 Which list tag lists steps in order? (a) <ul> (b) <li> (c) <ol>
  31. 31.📋 What number does the browser show next to “Litchi”?
    <ol start="5">
      <li>Grapes</li>
      <li>Mango</li>
      <li>Litchi</li>
    </ol>
  32. 32.🔗 Which tag makes a clickable link? (a) <link> (b) <p> (c) <img> (d) <a>
  33. 33.🔠 Which heading shows the BIGGEST text: <h5>, <h4>, <h3> or <h2>? (a) <h2> (b) <h5> (c) <h4> (d) <h3>
  34. 34.💬 Which text will NOT show on the page?
    <p>Cricket is fun.</p>
    <p>Hello, world!</p>
    <!-- <p>My pets</p> -->
    <p>Fun facts</p>
    (a) Hello, world! (b) My pets (c) Fun facts (d) Cricket is fun.
  35. 35.🔤 In “HTML”, what does the L stand for? (a) Language (b) Link (c) Laptop (d) Line
  36. 36.🔠 Which heading shows the SMALLEST text: <h1>, <h6>, <h3> or <h2>? (a) <h2> (b) <h1> (c) <h6> (d) <h3>
  37. 37.🔠 Which heading shows the BIGGEST text: <h1>, <h6>, <h2> or <h4>? (a) <h4> (b) <h6> (c) <h2> (d) <h1>
  38. 38.🔢 In a basic web page file, which comes FIRST? (a) </body> (b) <!DOCTYPE html> (c) <html> (d) <head>
  39. 39.💬 Which text will NOT show on the page?
    <p>Hello, world!</p>
    <p>My pets</p>
    <!-- <p>Fun facts</p> -->
    (a) My pets (b) Hello, world! (c) Fun facts
  40. 40.💬 Which text will NOT show on the page?
    <!-- <p>I love mangoes.</p> -->
    <p>The red kite</p>
    <p>My pets</p>
    <p>Hello, world!</p>
    (a) My pets (b) I love mangoes. (c) Hello, world! (d) The red kite

Answer key

  1. <!--
  2. Play games
  3. <ol>
  4. Class 7 Blog
  5. 2
  6. Class 7 Blog
  7. 3
  8. 1
  9. False
  10. bullets
  11. No
  12. True
  13. an opening tag
  14. width
  15. Yes
  16. src
  17. in a new tab
  18. quiz.html
  19. True
  20. opens it in a new tab
  21. My Hobbies
  22. href
  23. No
  24. tiger.jpg
  25. True
  26. shows line numbers
  27. in the body
  28. </b>
  29. shows line numbers
  30. <ol>
  31. 7
  32. <a>
  33. <h2>
  34. My pets
  35. Language
  36. <h6>
  37. <h1>
  38. <!DOCTYPE html>
  39. Fun facts
  40. I love mangoes.

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