← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 860 · 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 coders write comments? (a) to add colour (b) to make links (c) to leave notes (d) to show pictures
  2. 2.🏷️ What does a closing tag have that an opening tag does not? (a) a slash / (b) a dot . (c) a hash # (d) a dollar $
  3. 3.💬 How does an HTML comment end? (a) --> (b) */ (c) // (d) >>
  4. 4.True or false: <li> is one item of a list. (a) True (b) False
  5. 5.🔠 Which heading shows the BIGGEST text: <h4>, <h2>, <h1> or <h3>? (a) <h4> (b) <h1> (c) <h3> (d) <h2>
  6. 6.📄 Where does <meta charset="utf-8"> go: in the head or in the body? (a) in the body (b) in the head
  7. 7.🖼️ Does <img> need a closing tag? (a) Yes (b) No
  8. 8.📋 How many items does this list show?
    <ul>
      <li>Banana</li>
      <li>Guava</li>
      <li>Litchi</li>
      <li>Jamun</li>
    </ul>
  9. 9.💬 How does an HTML comment start? (a) <!-- (b) /* (c) // (d) #
  10. 10.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="fort.jpg" alt="An old fort" width="200">
    (a) A tiger asleep (b) An old fort (c) width (d) fort.jpg
  11. 11.🔠 Are headings shown in bold by default? (a) No (b) Yes
  12. 12.🖼️ Why do we add alt text to an image? (a) to make it bigger (b) to load it faster (c) to colour it (d) to describe the image
  13. 13.🔠 How many headings are in this code?
    <h1>My pets</h1>
    <p>Hello, world!</p>
    <h2>Cricket is fun.</h2>
    <p>Cricket is fun.</p>
    <h2>My pets</h2>
  14. 14.🔢 In a basic web page file, which comes first: “<!DOCTYPE html>” or “</html>”? (a) </html> (b) <!DOCTYPE html>
  15. 15.🔠 Which tag is used for the main title on a page? (a) <h1> (b) <p> (c) <br> (d) <h6>
  16. 16.True or false: HTML on its own can make bullet lists. (a) False (b) True
  17. 17.🔠 How many heading levels does HTML have? (a) 3 (b) 6 (c) 10 (d) 4
  18. 18.🔠 Which heading shows the SMALLEST text: <h4>, <h2>, <h5> or <h1>? (a) <h4> (b) <h5> (c) <h1> (d) <h2>
  19. 19.True or false: in <img>, height sets how wide it is. (a) True (b) False
  20. 20.🔗 Where does this link open?
    <a href="games.html">Take the quiz</a>
    (a) in the same tab (b) in a new tab
  21. 21.Which of these is true of a code editor? (a) has an address bar (b) opens web pages for us (c) stores a website’s files (d) shows line numbers
  22. 22.📋 Which list tag is one item of a list? (a) <li> (b) <ul> (c) <ol>
  23. 23.🖼️ Which attribute of <img> describes the picture? (a) width (b) height (c) src (d) alt
  24. 24.🔠 Which heading shows the BIGGEST text: <h1>, <h6>, <h3> or <h4>? (a) <h6> (b) <h3> (c) <h4> (d) <h1>
  25. 25.📄 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>We won by 5 runs.</p>
    </body>
    </html>
    (a) Match report (b) We won by 5 runs. (c) index.html (d) Class 7 Blog
  26. 26.True or false: HTML on its own cannot count button clicks. (a) True (b) False
  27. 27.🔍 One closing tag is missing. Which one?
    <h1>The red kite</h1>
    <h2>My pets
    <u>Our school trip</u>
    (a) </h1> (b) </h3> (c) </u> (d) </h2>
  28. 28.💬 Does the browser show comments on the page? (a) No (b) Yes
  29. 29.🔍 Which is the odd one out? (a) saves our .html files (b) is where we type code (c) opens web pages for us (d) colours code to help us
  30. 30.💬 How many paragraphs show on the page?
    <p>My pets</p>
    <!-- <p>Our school trip</p> -->
    <!-- <p>Good morning!</p> -->
  31. 31.📄 Can HTML on its own make headings? (a) Yes (b) No
  32. 32.🖼️ Which attribute of <img> shows if the image fails? (a) alt (b) width (c) height (d) src
  33. 33.📄 Can HTML on its own show paragraphs? (a) Yes (b) No
  34. 34.🖼️ How many pixels wide is the picture drawn?
    <img src="fort.jpg" alt="An old fort" width="50">
  35. 35.🔢 In a basic web page file, which comes LAST? (a) <!DOCTYPE html> (b) <body> (c) </html> (d) </head>
  36. 36.📋 What number does the browser show next to “Orange”?
    <ol start="2">
      <li>Banana</li>
      <li>Mango</li>
      <li>Jamun</li>
      <li>Orange</li>
    </ol>
  37. 37.🧩 An opening tag + content + a closing tag together make an ___. (a) element (b) editor (c) attribute (d) address
  38. 38.💬 How many paragraphs show on the page?
    <!-- <p>My pets</p> -->
    <p>Hello, world!</p>
    <p>I love mangoes.</p>
    <!-- <p>Fun facts</p> -->
    <!-- <p>Our school trip</p> -->
  39. 39.📄 What does the browser tab show for this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Cricket Club</title>
    </head>
    <body>
      <h1>My drawings</h1>
      <p>Mars is red.</p>
    </body>
    </html>
    (a) My drawings (b) Cricket Club (c) index.html (d) Mars is red.
  40. 40.🔗 Which words do you click on?
    <a href="about.html">About us</a>
    (a) about.html (b) href (c) About us (d) Contact us

Answer key

  1. to leave notes
  2. a slash /
  3. -->
  4. True
  5. <h1>
  6. in the head
  7. No
  8. 4
  9. <!--
  10. An old fort
  11. Yes
  12. to describe the image
  13. 3
  14. <!DOCTYPE html>
  15. <h1>
  16. True
  17. 6
  18. <h5>
  19. False
  20. in the same tab
  21. shows line numbers
  22. <li>
  23. alt
  24. <h1>
  25. Class 7 Blog
  26. True
  27. </h2>
  28. No
  29. opens web pages for us
  30. 1
  31. Yes
  32. alt
  33. Yes
  34. 50
  35. </html>
  36. 5
  37. element
  38. 2
  39. Cricket Club
  40. About us

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