← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 740 · 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 is the big heading shown on this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Space Facts</title>
    </head>
    <body>
      <h1>Easy snacks</h1>
      <p>Try this poha.</p>
    </body>
    </html>
    (a) Space Facts (b) Try this poha. (c) Easy snacks (d) body
  2. 2.🔗 Which words do you click on?
    <a href="quiz.html">Visit the site</a>
    (a) quiz.html (b) Maths fun (c) Visit the site (d) href
  3. 3.📝 On how many lines does the browser show this paragraph?
    <p>Birds sing<br>Sky is blue</p>
  4. 4.🔠 How many headings are in this code?
    <h1>I love mangoes.</h1>
    <h2>The red kite</h2>
    <p>My best friend</p>
  5. 5.💬 How many paragraphs show on the page?
    <p>Hello, world!</p>
    <!-- <p>Good morning!</p> -->
    <!-- <p>Rain today</p> -->
  6. 6.📋 How many items does this list show?
    <ul>
      <li>Banana</li>
      <li>Litchi</li>
    </ul>
  7. 7.Which of these goes in the body? (a) <img> (b) <link rel="stylesheet"> (c) <style> (d) <meta charset="utf-8">
  8. 8.🖼️ Which attribute of <img> describes the picture? (a) height (b) width (c) src (d) alt
  9. 9.🖼️ How many pixels wide is the picture drawn?
    <img src="tiger.jpg" alt="A tiger asleep" width="350">
  10. 10.🔤 In “HTML”, what does the M stand for? (a) Modern (b) Mouse (c) Machine (d) Markup
  11. 11.📋 What number does the browser show next to “Litchi”?
    <ol>
      <li>Guava</li>
      <li>Mango</li>
      <li>Litchi</li>
    </ol>
  12. 12.💬 How many paragraphs show on the page?
    <!-- <p>My best friend</p> -->
    <!-- <p>Hello, world!</p> -->
    <!-- <p>Fun facts</p> -->
    <p>Good morning!</p>
    <p>My pets</p>
  13. 13.💬 Can anyone read your comments by viewing the page source? (a) Yes (b) No
  14. 14.📝 On how many lines does the browser show this paragraph?
    <p>Birds sing<br>Roses are red<br>Stars shine<br>Rivers flow<br>Sky is blue</p>
  15. 15.True or false: HTML on its own can run a game loop. (a) True (b) False
  16. 16.🔠 Which heading shows the BIGGEST text: <h4>, <h5>, <h1> or <h3>? (a) <h5> (b) <h4> (c) <h3> (d) <h1>
  17. 17.💬 Which text will NOT show on the page?
    <!-- <p>My best friend</p> -->
    <p>The red kite</p>
    <p>Rain today</p>
    <p>Good morning!</p>
    (a) Rain today (b) My best friend (c) Good morning! (d) The red kite
  18. 18.📄 What is the first line of an HTML5 page? (a) <html> (b) <head> (c) <body> (d) <!DOCTYPE html>
  19. 19.🌐 Which one shows line numbers? (a) a web server (b) a web browser (c) a code editor
  20. 20.🌐 Which one sends pages over the net? (a) a web server (b) a web browser (c) a code editor
  21. 21.🔠 Which heading shows the SMALLEST text: <h1>, <h6>, <h3> or <h4>? (a) <h1> (b) <h3> (c) <h6> (d) <h4>
  22. 22.🔠 Which heading shows the BIGGEST text: <h1>, <h2>, <h5> or <h3>? (a) <h3> (b) <h2> (c) <h1> (d) <h5>
  23. 23.🔠 How many headings are in this code?
    <h1>Hello, world!</h1>
    <p>Cricket is fun.</p>
    <p>My pets</p>
  24. 24.🖼️ Which attribute of <img> sets how tall it is? (a) height (b) alt (c) width (d) src
  25. 25.🔗 What does target="_blank" do to a link? (a) makes it blank (b) opens it in a new tab (c) makes it bold (d) hides the link
  26. 26.💬 How does an HTML comment start? (a) # (b) // (c) /* (d) <!--
  27. 27.📝 How many paragraphs does this code make?
    <p>Cricket is fun.</p>
    <h2>I love mangoes.</h2>
    <p>Cricket is fun.</p>
  28. 28.🖼️ Which attribute of <img> is read by screen readers? (a) width (b) src (c) height (d) alt
  29. 29.💬 Which text will NOT show on the page?
    <p>Rain today</p>
    <p>Hello, world!</p>
    <p>My best friend</p>
    <!-- <p>My pets</p> -->
    (a) My best friend (b) Hello, world! (c) Rain today (d) My pets
  30. 30.📋 What number does the browser show next to “Guava”?
    <ol>
      <li>Litchi</li>
      <li>Papaya</li>
      <li>Grapes</li>
      <li>Guava</li>
      <li>Orange</li>
      <li>Mango</li>
    </ol>
  31. 31.🔍 Which line is missing its closing tag?
    line 1: <b>Good morning!</b>
    line 2: <h2>I love mangoes.</h2>
    line 3: <strong>Rain today
    (a) line 1 (b) line 3 (c) line 2
  32. 32.📝 Does <li> have a closing tag, or is it an empty tag? (a) has a closing tag (b) an empty tag
  33. 33.💬 How many paragraphs show on the page?
    <!-- <p>I love mangoes.</p> -->
    <!-- <p>Hello, world!</p> -->
    <p>Fun facts</p>
    <p>The red kite</p>
    <!-- <p>Rain today</p> -->
  34. 34.🔢 In a basic web page file, which comes first: “</body>” or “<head>”? (a) </body> (b) <head>
  35. 35.🏷️ Which is the closing tag for <h3>? (a) <h3/> (b) </h3> (c) <h3> (d) <\h3>
  36. 36.🔠 Which tag is the least important heading? (a) <h1> (b) <h6> (c) <h3> (d) <p>
  37. 37.🖼️ Why do we add alt text to an image? (a) to colour it (b) to load it faster (c) to describe the image (d) to make it bigger
  38. 38.💬 How many paragraphs show on the page?
    <!-- <p>I love mangoes.</p> -->
    <!-- <p>The red kite</p> -->
    <p>Cricket is fun.</p>
    <!-- <p>Good morning!</p> -->
  39. 39.💬 How many paragraphs show on the page?
    <p>Rain today</p>
    <!-- <p>My best friend</p> -->
    <p>Our school trip</p>
    <p>Cricket is fun.</p>
  40. 40.Which of these goes in the head? (a) <p> (b) <ul> (c) <style> (d) <h1>

Answer key

  1. Easy snacks
  2. Visit the site
  3. 2
  4. 2
  5. 1
  6. 2
  7. <img>
  8. alt
  9. 350
  10. Markup
  11. 3
  12. 2
  13. Yes
  14. 5
  15. False
  16. <h1>
  17. My best friend
  18. <!DOCTYPE html>
  19. a code editor
  20. a web server
  21. <h6>
  22. <h1>
  23. 1
  24. height
  25. opens it in a new tab
  26. <!--
  27. 2
  28. alt
  29. My pets
  30. 4
  31. line 3
  32. has a closing tag
  33. 2
  34. <head>
  35. </h3>
  36. <h6>
  37. to describe the image
  38. 1
  39. 3
  40. <style>

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