← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 584 · 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.True or false: in <img>, alt sets how tall it is. (a) False (b) True
  2. 2.💬 How many paragraphs show on the page?
    <!-- <p>Rain today</p> -->
    <!-- <p>My pets</p> -->
    <!-- <p>Our school trip</p> -->
    <p>Fun facts</p>
  3. 3.🔡 Are HTML tag names usually written in small letters? (a) No (b) Yes
  4. 4.🔗 What does target="_blank" do to a link? (a) makes it bold (b) hides the link (c) opens it in a new tab (d) makes it blank
  5. 5.Which of these is a closing tag? (a) <b> (b) </b> (c) <body> (d) <h1>
  6. 6.🔗 Which code links to about.html? (a) <a src="about.html"> (b) <a alt="about.html"> (c) <link about.html> (d) <a href="about.html">
  7. 7.📋 Does this list show bullets or numbers?
    <ul>
      <li>Litchi</li>
      <li>Jamun</li>
    </ul>
    (a) bullets (b) numbers
  8. 8.💬 Why do coders write comments? (a) to add colour (b) to make links (c) to show pictures (d) to leave notes
  9. 9.💬 How does an HTML comment start? (a) /* (b) # (c) // (d) <!--
  10. 10.📋 How many items does this list show?
    <ul>
      <li>Mango</li>
      <li>Litchi</li>
    </ul>
  11. 11.🔗 Where does this link open?
    <a href="contact.html">Take the quiz</a>
    (a) in a new tab (b) in the same tab
  12. 12.📄 What is the big heading shown on this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Cricket Club</title>
    </head>
    <body>
      <h1>Easy snacks</h1>
      <p>Try this poha.</p>
    </body>
    </html>
    (a) Try this poha. (b) Cricket Club (c) body (d) Easy snacks
  13. 13.📄 What is the first line of an HTML5 page? (a) <head> (b) <html> (c) <body> (d) <!DOCTYPE html>
  14. 14.📝 On how many lines does the browser show this paragraph?
    <p>Roses are red<br>Kites fly high<br>Birds sing<br>Rivers flow<br>Stars shine</p>
  15. 15.🔗 Which tag makes a clickable link? (a) <link> (b) <a> (c) <img> (d) <p>
  16. 16.📄 Can HTML on its own make links to pages? (a) No (b) Yes
  17. 17.📄 What does the browser tab show for this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Space Facts</title>
    </head>
    <body>
      <h1>All about me</h1>
      <p>I like to read.</p>
    </body>
    </html>
    (a) I like to read. (b) All about me (c) index.html (d) Space Facts
  18. 18.True or false: in <img>, src names the picture file. (a) False (b) True
  19. 19.🏷️ Is </p> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
  20. 20.🔗 Which address opens when you click this link?
    <a href="about.html">Visit the site</a>
    (a) contact.html (b) https://example.com (c) Visit the site (d) about.html
  21. 21.📝 What does <hr> draw? (a) a picture (b) a line across the page (c) a table (d) a link
  22. 22.📋 Which list tag shows bullet points? (a) <ol> (b) <ul> (c) <li>
  23. 23.True or false: <li> is an ordered list. (a) False (b) True
  24. 24.🔍 One closing tag is missing. Which one?
    <strong>Rain today</strong>
    <h2>My best friend
    <small>Our school trip</small>
    (a) </strong> (b) </small> (c) </h2> (d) </p>
  25. 25.📝 On how many lines does the browser show this paragraph?
    <p>Roses are red<br>Sky is blue<br>Stars shine<br>Rivers flow</p>
  26. 26.🔠 Which heading shows the SMALLEST text: <h1>, <h3>, <h4> or <h6>? (a) <h4> (b) <h6> (c) <h3> (d) <h1>
  27. 27.🔗 Which address opens when you click this link?
    <a href="https://example.com">Play games</a>
    (a) art.html (b) Play games (c) maths.html (d) https://example.com
  28. 28.📄 What is the big heading shown on this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>My Hobbies</title>
    </head>
    <body>
      <h1>Planets</h1>
      <p>We won by 5 runs.</p>
    </body>
    </html>
    (a) Planets (b) body (c) My Hobbies (d) We won by 5 runs.
  29. 29.📋 Which list tag lists things in any order? (a) <li> (b) <ol> (c) <ul>
  30. 30.🖼️ Which picture file does the browser load?
    <img src="bus.jpg" alt="Our school bus" width="100">
    (a) tiger.jpg (b) Our school bus (c) fort.jpg (d) bus.jpg
  31. 31.📋 How many items does this list show?
    <ul>
      <li>Orange</li>
      <li>Banana</li>
      <li>Litchi</li>
      <li>Papaya</li>
      <li>Mango</li>
    </ul>
  32. 32.🖼️ Which attribute of <img> shows if the image fails? (a) src (b) height (c) alt (d) width
  33. 33.🔍 Which is the odd one out? (a) stores a website’s files (b) sends pages over the net (c) is where we type code (d) answers page requests
  34. 34.🔍 One closing tag is missing. Which one?
    <b>Our school trip</b>
    <p>My best friend</p>
    <strong>Hello, world!
    (a) </u> (b) </b> (c) </p> (d) </strong>
  35. 35.True or false: HTML on its own can keep a high score. (a) True (b) False
  36. 36.🔗 Which address opens when you click this link?
    <a href="games.html">About us</a>
    (a) contact.html (b) about.html (c) games.html (d) About us
  37. 37.💾 A web page file usually ends with which extension? (a) .mp3 (b) .txt (c) .html (d) .png
  38. 38.🔗 Which attribute holds the address of a link? (a) src (b) alt (c) id (d) href
  39. 39.📄 Where does <meta charset="utf-8"> go: in the head or in the body? (a) in the head (b) in the body
  40. 40.Which of these is an empty tag? (a) <img> (b) <h1> (c) <ul> (d) <title>

Answer key

  1. False
  2. 1
  3. Yes
  4. opens it in a new tab
  5. </b>
  6. <a href="about.html">
  7. bullets
  8. to leave notes
  9. <!--
  10. 2
  11. in the same tab
  12. Easy snacks
  13. <!DOCTYPE html>
  14. 5
  15. <a>
  16. Yes
  17. Space Facts
  18. True
  19. a closing tag
  20. about.html
  21. a line across the page
  22. <ul>
  23. False
  24. </h2>
  25. 4
  26. <h6>
  27. https://example.com
  28. Planets
  29. <ul>
  30. bus.jpg
  31. 5
  32. alt
  33. is where we type code
  34. </strong>
  35. False
  36. games.html
  37. .html
  38. href
  39. in the head
  40. <img>

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