← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 500 · 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.🔍 Which line is missing its closing tag?
    line 1: <h2>The red kite
    line 2: <p>Our school trip</p>
    line 3: <h1>I love mangoes.</h1>
    (a) line 2 (b) line 1 (c) line 3
  2. 2.🔢 In a basic web page file, which comes LAST? (a) <head> (b) <!DOCTYPE html> (c) </body> (d) </html>
  3. 3.🔠 Which tag is used for the main title on a page? (a) <h6> (b) <p> (c) <br> (d) <h1>
  4. 4.📄 Where does <a> go: in the head or in the body? (a) in the head (b) in the body
  5. 5.Which of these is an opening tag? (a) </body> (b) <p> (c) </p> (d) </h1>
  6. 6.📋 How many items does this list show?
    <ul>
      <li>Orange</li>
      <li>Guava</li>
    </ul>
  7. 7.📝 How many paragraphs does this code make?
    <p>Fun facts</p>
    <h2>The red kite</h2>
    <h2>My pets</h2>
    <p>Hello, world!</p>
    <h2>Rain today</h2>
  8. 8.True or false: a code editor is where we type code. (a) True (b) False
  9. 9.🏷️ Is </b> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
  10. 10.🏷️ Is <body> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
  11. 11.Which of these is a closing tag? (a) <body> (b) <p> (c) </p> (d) <li>
  12. 12.💬 How does an HTML comment end? (a) --> (b) >> (c) // (d) */
  13. 13.True or false: in <img>, width sets how wide it is. (a) False (b) True
  14. 14.🖼️ How many pixels wide is the picture drawn?
    <img src="moon.png" alt="The full moon" width="150">
  15. 15.💬 Which text will NOT show on the page?
    <!-- <p>Hello, world!</p> -->
    <p>Cricket is fun.</p>
    <p>The red kite</p>
    <p>Good morning!</p>
    (a) Cricket is fun. (b) Good morning! (c) The red kite (d) Hello, world!
  16. 16.🔍 Which line is missing its closing tag?
    line 1: <u>I love mangoes.</u>
    line 2: <h3>Hello, world!</h3>
    line 3: <p>The red kite
    (a) line 3 (b) line 2 (c) line 1
  17. 17.🖼️ Which tag puts a picture on a page? (a) <p> (b) <img> (c) <pic> (d) <a>
  18. 18.🏷️ Which is the closing tag for <em>? (a) <em/> (b) </em> (c) <\em> (d) <em>
  19. 19.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="fort.jpg" alt="An old fort" width="100">
    (a) width (b) fort.jpg (c) An old fort (d) A tiger asleep
  20. 20.🔗 Where does this link open?
    <a href="contact.html" target="_blank">Visit the site</a>
    (a) in a new tab (b) in the same tab
  21. 21.🔢 In a basic web page file, which comes FIRST? (a) <!DOCTYPE html> (b) <body> (c) </html> (d) <head>
  22. 22.🔗 Which address opens when you click this link?
    <a href="https://example.com">Contact us</a>
    (a) Contact us (b) https://example.com (c) maths.html (d) art.html
  23. 23.💬 Which text will NOT show on the page?
    <!-- <p>My best friend</p> -->
    <p>Rain today</p>
    <p>Fun facts</p>
    <p>Good morning!</p>
    (a) Fun facts (b) Rain today (c) Good morning! (d) My best friend
  24. 24.True or false: HTML on its own cannot run a game loop. (a) False (b) True
  25. 25.True or false: HTML on its own can make tables. (a) False (b) True
  26. 26.🔠 Which heading shows the BIGGEST text: <h3>, <h1>, <h6> or <h2>? (a) <h3> (b) <h1> (c) <h2> (d) <h6>
  27. 27.🔍 One closing tag is missing. Which one?
    <u>My pets
    <h3>Good morning!</h3>
    <em>Our school trip</em>
    (a) </h3> (b) </small> (c) </em> (d) </u>
  28. 28.💬 Which text will NOT show on the page?
    <p>Good morning!</p>
    <p>My best friend</p>
    <!-- <p>Rain today</p> -->
    <p>My pets</p>
    (a) My best friend (b) Good morning! (c) Rain today (d) My pets
  29. 29.🧩 An opening tag + content + a closing tag together make an ___. (a) attribute (b) address (c) editor (d) element
  30. 30.🔠 Which heading shows the SMALLEST text: <h4>, <h1>, <h2> or <h3>? (a) <h2> (b) <h4> (c) <h3> (d) <h1>
  31. 31.📛 In <a href="x.html">, what is href? (a) an attribute (b) a closing tag (c) a comment (d) an element name
  32. 32.Which of these is true of a code editor? (a) has an address bar (b) saves our .html files (c) opens web pages for us (d) answers page requests
  33. 33.📝 On how many lines does the browser show this paragraph?
    <p>Roses are red<br>Stars shine<br>Rivers flow<br>Kites fly high<br>Birds sing</p>
  34. 34.📄 What is the first line of an HTML5 page? (a) <html> (b) <body> (c) <head> (d) <!DOCTYPE html>
  35. 35.🔗 Where does this link open?
    <a href="https://example.com" target="_blank">Maths fun</a>
    (a) in a new tab (b) in the same tab
  36. 36.🔗 Which attribute holds the address of a link? (a) src (b) id (c) alt (d) href
  37. 37.💬 Which text will NOT show on the page?
    <!-- <p>Our school trip</p> -->
    <p>My pets</p>
    <p>Cricket is fun.</p>
    <p>I love mangoes.</p>
    (a) My pets (b) Cricket is fun. (c) Our school trip (d) I love mangoes.
  38. 38.🔠 Which heading shows the BIGGEST text: <h2>, <h1>, <h3> or <h5>? (a) <h5> (b) <h1> (c) <h2> (d) <h3>
  39. 39.🔠 How many headings are in this code?
    <h1>Our school trip</h1>
    <h3>The red kite</h3>
    <p>My pets</p>
    <p>I love mangoes.</p>
  40. 40.💬 How many paragraphs show on the page?
    <!-- <p>Hello, world!</p> -->
    <!-- <p>Good morning!</p> -->
    <!-- <p>Rain today</p> -->
    <p>Cricket is fun.</p>
    <p>The red kite</p>

Answer key

  1. line 1
  2. </html>
  3. <h1>
  4. in the body
  5. <p>
  6. 2
  7. 2
  8. True
  9. a closing tag
  10. an opening tag
  11. </p>
  12. -->
  13. True
  14. 150
  15. Hello, world!
  16. line 3
  17. <img>
  18. </em>
  19. An old fort
  20. in a new tab
  21. <!DOCTYPE html>
  22. https://example.com
  23. My best friend
  24. True
  25. True
  26. <h1>
  27. </u>
  28. Rain today
  29. element
  30. <h4>
  31. an attribute
  32. saves our .html files
  33. 5
  34. <!DOCTYPE html>
  35. in a new tab
  36. href
  37. Our school trip
  38. <h1>
  39. 2
  40. 2

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