← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 205 · 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: <u>Hello, world!</u>
    line 2: <b>Fun facts</b>
    line 3: <p>Rain today
    (a) line 2 (b) line 1 (c) line 3
  2. 2.🔠 Which heading shows the BIGGEST text: <h4>, <h1>, <h5> or <h2>? (a) <h4> (b) <h1> (c) <h5> (d) <h2>
  3. 3.💬 How many paragraphs show on the page?
    <!-- <p>Our school trip</p> -->
    <!-- <p>My pets</p> -->
    <!-- <p>I love mangoes.</p> -->
    <p>Rain today</p>
    <!-- <p>Good morning!</p> -->
  4. 4.True or false: a code editor sends pages over the net. (a) False (b) True
  5. 5.🔢 In a basic web page file, which comes first: “<!DOCTYPE html>” or “<head>”? (a) <!DOCTYPE html> (b) <head>
  6. 6.📄 What is the big heading shown on this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Space Facts</title>
    </head>
    <body>
      <h1>All about me</h1>
      <p>Mars is red.</p>
    </body>
    </html>
    (a) All about me (b) Space Facts (c) Mars is red. (d) body
  7. 7.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="map.png" alt="Map of India" width="350">
    (a) Map of India (b) Birthday cake (c) map.png (d) width
  8. 8.🔢 In a basic web page file, which comes LAST? (a) <body> (b) </head> (c) </html> (d) <!DOCTYPE html>
  9. 9.📄 What is the first line of an HTML5 page? (a) <html> (b) <!DOCTYPE html> (c) <head> (d) <body>
  10. 10.Which of these goes in the body? (a) <title> (b) <style> (c) <meta charset="utf-8"> (d) <h1>
  11. 11.🏷️ Is </h1> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
  12. 12.📝 How many paragraphs does this code make?
    <p>Cricket is fun.</p>
    <p>The red kite</p>
    <p>Fun facts</p>
  13. 13.🔠 Which tag is used for the main title on a page? (a) <p> (b) <br> (c) <h1> (d) <h6>
  14. 14.💬 Why do coders write comments? (a) to add colour (b) to leave notes (c) to make links (d) to show pictures
  15. 15.True or false: HTML on its own cannot keep a high score. (a) True (b) False
  16. 16.💬 How many paragraphs show on the page?
    <!-- <p>I love mangoes.</p> -->
    <p>My pets</p>
    <p>Cricket is fun.</p>
    <!-- <p>The red kite</p> -->
    <!-- <p>Hello, world!</p> -->
  17. 17.🌐 Which one is where we type code? (a) a web browser (b) a code editor (c) a web server
  18. 18.Which of these has a closing tag? (a) <img> (b) <meta> (c) <br> (d) <b>
  19. 19.🔢 In a basic web page file, which comes first: “<body>” or “<html>”? (a) <html> (b) <body>
  20. 20.🔠 How many heading levels does HTML have? (a) 10 (b) 4 (c) 3 (d) 6
  21. 21.True or false: <p> is an empty tag. (a) True (b) False
  22. 22.Which of these goes in the head? (a) <p> (b) <link rel="stylesheet"> (c) <table> (d) <img>
  23. 23.🔗 Where does this link open?
    <a href="art.html" target="_blank">Play games</a>
    (a) in the same tab (b) in a new tab
  24. 24.Which of these goes in the body? (a) <meta charset="utf-8"> (b) <title> (c) <style> (d) <img>
  25. 25.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="fort.jpg" alt="An old fort" width="350">
    (a) A tiger asleep (b) width (c) fort.jpg (d) An old fort
  26. 26.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="tiger.jpg" alt="A tiger asleep" width="100">
    (a) width (b) tiger.jpg (c) A tiger asleep (d) A red kite
  27. 27.📝 How many paragraphs does this code make?
    <p>Cricket is fun.</p>
    <h2>My pets</h2>
    <p>My pets</p>
    <p>Cricket is fun.</p>
  28. 28.Which of these is an empty tag? (a) <ul> (b) <p> (c) <li> (d) <hr>
  29. 29.💬 Can anyone read your comments by viewing the page source? (a) No (b) Yes
  30. 30.🧩 An opening tag + content + a closing tag together make an ___. (a) attribute (b) editor (c) address (d) element
  31. 31.🔗 Which tag makes a clickable link? (a) <p> (b) <img> (c) <a> (d) <link>
  32. 32.🖼️ Which attribute of <img> is read by screen readers? (a) src (b) height (c) width (d) alt
  33. 33.🔗 Which words do you click on?
    <a href="maths.html">About us</a>
    (a) Contact us (b) href (c) maths.html (d) About us
  34. 34.Which of these has a closing tag? (a) <hr> (b) <img> (c) <li> (d) <br>
  35. 35.🌍 Which program shows a web page to us? (a) a web browser (b) a music player (c) a paint program (d) a calculator
  36. 36.💬 How does an HTML comment end? (a) >> (b) */ (c) --> (d) //
  37. 37.📄 What is the big heading shown on this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Space Facts</title>
    </head>
    <body>
      <h1>My drawings</h1>
      <p>Here is my best one.</p>
    </body>
    </html>
    (a) My drawings (b) body (c) Space Facts (d) Here is my best one.
  38. 38.🔠 Which heading shows the SMALLEST text: <h2>, <h5>, <h1> or <h4>? (a) <h2> (b) <h5> (c) <h1> (d) <h4>
  39. 39.📋 How many items does this list show?
    <ol>
      <li>Jamun</li>
      <li>Grapes</li>
    </ol>
  40. 40.True or false: in <img>, alt is read by screen readers. (a) False (b) True

Answer key

  1. line 3
  2. <h1>
  3. 1
  4. False
  5. <!DOCTYPE html>
  6. All about me
  7. Map of India
  8. </html>
  9. <!DOCTYPE html>
  10. <h1>
  11. a closing tag
  12. 3
  13. <h1>
  14. to leave notes
  15. True
  16. 2
  17. a code editor
  18. <b>
  19. <html>
  20. 6
  21. False
  22. <link rel="stylesheet">
  23. in a new tab
  24. <img>
  25. An old fort
  26. A tiger asleep
  27. 3
  28. <hr>
  29. Yes
  30. element
  31. <a>
  32. alt
  33. About us
  34. <li>
  35. a web browser
  36. -->
  37. My drawings
  38. <h5>
  39. 2
  40. True

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