← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 551 · 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.🖼️ Why do we add alt text to an image? (a) to load it faster (b) to describe the image (c) to colour it (d) to make it bigger
  2. 2.Which of these is an opening tag? (a) </li> (b) <h1> (c) </p> (d) </h1>
  3. 3.True or false: <ul> goes inside ul or ol. (a) True (b) False
  4. 4.🖼️ How many pixels wide is the picture drawn?
    <img src="fort.jpg" alt="An old fort" width="150">
  5. 5.📝 How many paragraphs does this code make?
    <p>Good morning!</p>
    <p>Cricket is fun.</p>
    <h2>The red kite</h2>
    <h2>The red kite</h2>
    <p>I love mangoes.</p>
  6. 6.📝 On how many lines does the browser show this paragraph?
    <p>Sky is blue<br>Rivers flow</p>
  7. 7.📋 Which list tag is an ordered list? (a) <ul> (b) <ol> (c) <li>
  8. 8.📝 Does <input> have a closing tag, or is it an empty tag? (a) has a closing tag (b) an empty tag
  9. 9.🔗 What does HyperText mean? (a) text with links (b) very big text (c) text in colour (d) secret text
  10. 10.🖼️ Which picture file does the browser load?
    <img src="fort.jpg" alt="An old fort" width="350">
    (a) kite.png (b) An old fort (c) fort.jpg (d) tiger.jpg
  11. 11.🔠 How many headings are in this code?
    <h1>The red kite</h1>
    <p>Cricket is fun.</p>
    <p>The red kite</p>
    <p>Fun facts</p>
  12. 12.🔍 Which line is missing its closing tag?
    line 1: <small>The red kite</small>
    line 2: <em>Our school trip</em>
    line 3: <h1>Good morning!
    (a) line 3 (b) line 1 (c) line 2
  13. 13.🏷️ Is </li> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
  14. 14.🔍 One closing tag is missing. Which one?
    <em>My pets</em>
    <h1>Fun facts
    <u>I love mangoes.</u>
    (a) </i> (b) </u> (c) </h1> (d) </em>
  15. 15.💬 How does an HTML comment end? (a) >> (b) */ (c) // (d) -->
  16. 16.📄 What is the big heading shown on this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Riya’s Recipes</title>
    </head>
    <body>
      <h1>My drawings</h1>
      <p>Thanks for visiting.</p>
    </body>
    </html>
    (a) body (b) Riya’s Recipes (c) Thanks for visiting. (d) My drawings
  17. 17.True or false: <li> lists things in any order. (a) True (b) False
  18. 18.📝 What does <p> make? (a) a paragraph (b) a picture (c) a link (d) a table
  19. 19.📄 Can HTML on its own pick a random number? (a) Yes (b) No
  20. 20.🔠 Which heading shows the SMALLEST text: <h2>, <h4>, <h1> or <h6>? (a) <h2> (b) <h1> (c) <h6> (d) <h4>
  21. 21.🌐 Which one has an address bar? (a) a code editor (b) a web browser (c) a web server
  22. 22.📄 Where does the text of <title> appear? (a) in a big heading (b) on the browser tab (c) at the bottom (d) nowhere
  23. 23.📋 What number does the browser show next to “Litchi”?
    <ol start="9">
      <li>Jamun</li>
      <li>Banana</li>
      <li>Litchi</li>
    </ol>
  24. 24.🔤 In “HTML”, what does the M stand for? (a) Markup (b) Machine (c) Modern (d) Mouse
  25. 25.🧩 An opening tag + content + a closing tag together make an ___. (a) element (b) address (c) editor (d) attribute
  26. 26.🖼️ How many pixels wide is the picture drawn?
    <img src="tiger.jpg" alt="A tiger asleep" width="250">
  27. 27.True or false: <p> goes in the body. (a) False (b) True
  28. 28.📄 What does the browser tab show for this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Space Facts</title>
    </head>
    <body>
      <h1>Welcome!</h1>
      <p>We won by 5 runs.</p>
    </body>
    </html>
    (a) Welcome! (b) We won by 5 runs. (c) index.html (d) Space Facts
  29. 29.🔗 Which address opens when you click this link?
    <a href="contact.html">Take the quiz</a>
    (a) contact.html (b) maths.html (c) Take the quiz (d) https://example.com
  30. 30.💬 Which text will NOT show on the page?
    <p>Our school trip</p>
    <!-- <p>Good morning!</p> -->
    <p>My best friend</p>
    (a) My best friend (b) Good morning! (c) Our school trip
  31. 31.True or false: HTML on its own cannot run a game loop. (a) True (b) False
  32. 32.💬 How many paragraphs show on the page?
    <p>Rain today</p>
    <!-- <p>My pets</p> -->
    <p>Good morning!</p>
    <!-- <p>Hello, world!</p> -->
    <p>Fun facts</p>
  33. 33.🔠 Which heading shows the SMALLEST text: <h5>, <h6>, <h1> or <h4>? (a) <h1> (b) <h4> (c) <h6> (d) <h5>
  34. 34.🔍 One closing tag is missing. Which one?
    <small>I love mangoes.</small>
    <b>Fun facts
    <p>Hello, world!</p>
    (a) </p> (b) </b> (c) </u> (d) </small>
  35. 35.🔗 Which words do you click on?
    <a href="games.html">Visit the site</a>
    (a) Visit the site (b) Maths fun (c) games.html (d) href
  36. 36.📄 Where does <h1> go: in the head or in the body? (a) in the head (b) in the body
  37. 37.True or false: a web server colours code to help us. (a) False (b) True
  38. 38.💬 How does an HTML comment start? (a) /* (b) # (c) // (d) <!--
  39. 39.🏷️ What does a closing tag have that an opening tag does not? (a) a dollar $ (b) a hash # (c) a slash / (d) a dot .
  40. 40.🔗 Which words do you click on?
    <a href="art.html">Maths fun</a>
    (a) href (b) Maths fun (c) art.html (d) Art corner

Answer key

  1. to describe the image
  2. <h1>
  3. False
  4. 150
  5. 3
  6. 2
  7. <ol>
  8. an empty tag
  9. text with links
  10. fort.jpg
  11. 1
  12. line 3
  13. a closing tag
  14. </h1>
  15. -->
  16. My drawings
  17. False
  18. a paragraph
  19. No
  20. <h6>
  21. a web browser
  22. on the browser tab
  23. 11
  24. Markup
  25. element
  26. 250
  27. True
  28. Space Facts
  29. contact.html
  30. Good morning!
  31. True
  32. 3
  33. <h6>
  34. </b>
  35. Visit the site
  36. in the body
  37. False
  38. <!--
  39. a slash /
  40. Maths fun

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