← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 784 · 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.📝 What does <hr> draw? (a) a line across the page (b) a table (c) a link (d) a picture
  2. 2.🔠 How many headings are in this code?
    <h1>Cricket is fun.</h1>
    <p>Hello, world!</p>
    <p>My pets</p>
  3. 3.🔢 In a basic web page file, which comes first: “<head>” or “</body>”? (a) <head> (b) </body>
  4. 4.Which of these has a closing tag? (a) <meta> (b) <p> (c) <img> (d) <hr>
  5. 5.🔗 Which attribute holds the address of a link? (a) href (b) alt (c) src (d) id
  6. 6.💬 How many paragraphs show on the page?
    <!-- <p>My pets</p> -->
    <p>Hello, world!</p>
    <p>Rain today</p>
  7. 7.🔠 How many heading levels does HTML have? (a) 6 (b) 3 (c) 4 (d) 10
  8. 8.🔠 Which heading shows the SMALLEST text: <h5>, <h6>, <h4> or <h1>? (a) <h6> (b) <h5> (c) <h4> (d) <h1>
  9. 9.True or false: a web server stores a website’s files. (a) False (b) True
  10. 10.💬 Why do coders write comments? (a) to leave notes (b) to make links (c) to show pictures (d) to add colour
  11. 11.🔠 Which heading shows the BIGGEST text: <h4>, <h6>, <h1> or <h2>? (a) <h2> (b) <h6> (c) <h4> (d) <h1>
  12. 12.🔠 Which heading shows the BIGGEST text: <h2>, <h5>, <h4> or <h1>? (a) <h4> (b) <h2> (c) <h5> (d) <h1>
  13. 13.📄 What is the big heading shown on this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>My Hobbies</title>
    </head>
    <body>
      <h1>Planets</h1>
      <p>I like to read.</p>
    </body>
    </html>
    (a) Planets (b) My Hobbies (c) I like to read. (d) body
  14. 14.📝 How many paragraphs does this code make?
    <p>My best friend</p>
    <p>Fun facts</p>
    <p>Cricket is fun.</p>
  15. 15.💬 How many paragraphs show on the page?
    <p>My best friend</p>
    <!-- <p>Fun facts</p> -->
    <p>The red kite</p>
    <p>Rain today</p>
    <p>I love mangoes.</p>
  16. 16.🔠 Which heading shows the SMALLEST text: <h4>, <h1>, <h2> or <h5>? (a) <h2> (b) <h4> (c) <h1> (d) <h5>
  17. 17.🔠 How many headings are in this code?
    <h1>Cricket is fun.</h1>
    <h4>My best friend</h4>
    <h3>Good morning!</h3>
    <h3>My best friend</h3>
  18. 18.🖼️ Which attribute of <img> is read by screen readers? (a) src (b) alt (c) height (d) width
  19. 19.🌍 Which program shows a web page to us? (a) a web browser (b) a paint program (c) a calculator (d) a music player
  20. 20.🏷️ Which is the closing tag for <b>? (a) </b> (b) <b> (c) <b/> (d) <\b>
  21. 21.📄 Where does <table> go: in the head or in the body? (a) in the body (b) in the head
  22. 22.True or false: HTML on its own can count button clicks. (a) True (b) False
  23. 23.🔗 Which code links to about.html? (a) <a src="about.html"> (b) <link about.html> (c) <a alt="about.html"> (d) <a href="about.html">
  24. 24.🔠 Which heading shows the BIGGEST text: <h3>, <h1>, <h6> or <h2>? (a) <h2> (b) <h6> (c) <h1> (d) <h3>
  25. 25.🏷️ What does a closing tag have that an opening tag does not? (a) a dollar $ (b) a dot . (c) a slash / (d) a hash #
  26. 26.🔠 Which heading shows the BIGGEST text: <h2>, <h5>, <h1> or <h3>? (a) <h5> (b) <h2> (c) <h3> (d) <h1>
  27. 27.Which of these has a closing tag? (a) <h1> (b) <hr> (c) <meta> (d) <br>
  28. 28.Which of these is an opening tag? (a) </li> (b) </p> (c) </body> (d) <h1>
  29. 29.🏷️ Is </title> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
  30. 30.🌐 Which one shows line numbers? (a) a code editor (b) a web server (c) a web browser
  31. 31.📄 Where does <style> go: in the head or in the body? (a) in the head (b) in the body
  32. 32.🔗 What does target="_blank" do to a link? (a) opens it in a new tab (b) makes it blank (c) makes it bold (d) hides the link
  33. 33.🖼️ Why do we add alt text to an image? (a) to describe the image (b) to colour it (c) to load it faster (d) to make it bigger
  34. 34.🔍 Which line is missing its closing tag?
    line 1: <i>The red kite
    line 2: <h2>I love mangoes.</h2>
    line 3: <strong>Hello, world!</strong>
    (a) line 3 (b) line 2 (c) line 1
  35. 35.🔗 Which address opens when you click this link?
    <a href="quiz.html">Play games</a>
    (a) about.html (b) games.html (c) Play games (d) quiz.html
  36. 36.💬 Which text will NOT show on the page?
    <p>My pets</p>
    <!-- <p>My best friend</p> -->
    <p>Fun facts</p>
    <p>Rain today</p>
    (a) My best friend (b) My pets (c) Fun facts (d) Rain today
  37. 37.🔗 Which address opens when you click this link?
    <a href="https://example.com">Contact us</a>
    (a) https://example.com (b) art.html (c) Contact us (d) maths.html
  38. 38.🔗 Which address opens when you click this link?
    <a href="about.html">Play games</a>
    (a) https://example.com (b) contact.html (c) Play games (d) about.html
  39. 39.True or false: <ul> goes in the head. (a) False (b) True
  40. 40.📋 How many items does this list show?
    <ol>
      <li>Grapes</li>
      <li>Jamun</li>
      <li>Guava</li>
      <li>Mango</li>
    </ol>

Answer key

  1. a line across the page
  2. 1
  3. <head>
  4. <p>
  5. href
  6. 2
  7. 6
  8. <h6>
  9. True
  10. to leave notes
  11. <h1>
  12. <h1>
  13. Planets
  14. 3
  15. 4
  16. <h5>
  17. 4
  18. alt
  19. a web browser
  20. </b>
  21. in the body
  22. False
  23. <a href="about.html">
  24. <h1>
  25. a slash /
  26. <h1>
  27. <h1>
  28. <h1>
  29. a closing tag
  30. a code editor
  31. in the head
  32. opens it in a new tab
  33. to describe the image
  34. line 1
  35. quiz.html
  36. My best friend
  37. https://example.com
  38. about.html
  39. False
  40. 4

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