← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 20 · 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.🧩 An opening tag + content + a closing tag together make an ___. (a) editor (b) address (c) attribute (d) element
  2. 2.📄 Can HTML on its own make headings? (a) Yes (b) No
  3. 3.True or false: <hr> is an empty tag. (a) False (b) True
  4. 4.Which of these has a closing tag? (a) <input> (b) <img> (c) <b> (d) <br>
  5. 5.🔠 How many heading levels does HTML have? (a) 3 (b) 10 (c) 4 (d) 6
  6. 6.🔍 Which is the odd one out? (a) is where we type code (b) colours code to help us (c) shows line numbers (d) turns HTML into a page
  7. 7.🔍 One closing tag is missing. Which one?
    <b>Good morning!
    <u>Hello, world!</u>
    <h1>Our school trip</h1>
    (a) </u> (b) </h1> (c) </strong> (d) </b>
  8. 8.📝 What does <p> make? (a) a table (b) a link (c) a paragraph (d) a picture
  9. 9.🏷️ Is <b> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
  10. 10.🔗 Which words do you click on?
    <a href="https://example.com">Play games</a>
    (a) About us (b) https://example.com (c) Play games (d) href
  11. 11.🔠 Which heading shows the BIGGEST text: <h2>, <h5>, <h1> or <h3>? (a) <h2> (b) <h3> (c) <h5> (d) <h1>
  12. 12.True or false: in <img>, src names the picture file. (a) False (b) True
  13. 13.💬 How many paragraphs show on the page?
    <p>Rain today</p>
    <p>I love mangoes.</p>
    <p>My pets</p>
    <!-- <p>Our school trip</p> -->
    <p>Good morning!</p>
  14. 14.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="fort.jpg" alt="An old fort" width="350">
    (a) width (b) An old fort (c) fort.jpg (d) A tiger asleep
  15. 15.Which of these is an empty tag? (a) <h1> (b) <input> (c) <p> (d) <ul>
  16. 16.🔍 Which is the odd one out? (a) is where we type code (b) has an address bar (c) saves our .html files (d) colours code to help us
  17. 17.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="cake.jpg" alt="Birthday cake" width="300">
    (a) cake.jpg (b) Birthday cake (c) width (d) A happy dog
  18. 18.📄 Can HTML on its own pick a random number? (a) Yes (b) No
  19. 19.True or false: a web server sends pages over the net. (a) True (b) False
  20. 20.🏷️ Is <body> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
  21. 21.🔢 In a basic web page file, which comes first: “</html>” or “<head>”? (a) </html> (b) <head>
  22. 22.🔢 In a basic web page file, which comes first: “<body>” or “<html>”? (a) <body> (b) <html>
  23. 23.📄 What is the big heading shown on this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>My Hobbies</title>
    </head>
    <body>
      <h1>Welcome!</h1>
      <p>Thanks for visiting.</p>
    </body>
    </html>
    (a) My Hobbies (b) Welcome! (c) body (d) Thanks for visiting.
  24. 24.🖼️ Which attribute of <img> sets how wide it is? (a) height (b) width (c) src (d) alt
  25. 25.🏷️ Which is the closing tag for <p>? (a) <\p> (b) <p/> (c) </p> (d) <p>
  26. 26.True or false: HTML on its own can count button clicks. (a) True (b) False
  27. 27.📝 On how many lines does the browser show this paragraph?
    <p>Rivers flow<br>Sky is blue</p>
  28. 28.🔍 One closing tag is missing. Which one?
    <b>Rain today
    <h3>Fun facts</h3>
    <small>The red kite</small>
    (a) </h2> (b) </b> (c) </small> (d) </h3>
  29. 29.🔍 One closing tag is missing. Which one?
    <strong>I love mangoes.
    <h2>Good morning!</h2>
    <i>My pets</i>
    (a) </b> (b) </strong> (c) </i> (d) </h2>
  30. 30.📝 How many paragraphs does this code make?
    <p>The red kite</p>
    <h2>I love mangoes.</h2>
    <p>Cricket is fun.</p>
    <h2>My best friend</h2>
  31. 31.🖼️ How many pixels wide is the picture drawn?
    <img src="fort.jpg" alt="An old fort" width="250">
  32. 32.🔗 Which address opens when you click this link?
    <a href="about.html">Play games</a>
    (a) contact.html (b) Play games (c) https://example.com (d) about.html
  33. 33.Which of these is an opening tag? (a) </li> (b) </h1> (c) <li> (d) </p>
  34. 34.🌐 Which one is where we type code? (a) a web browser (b) a web server (c) a code editor
  35. 35.Which of these has a closing tag? (a) <img> (b) <meta> (c) <title> (d) <input>
  36. 36.🔠 How many headings are in this code?
    <h1>My pets</h1>
    <p>Hello, world!</p>
    <h3>Fun facts</h3>
    <h3>Cricket is fun.</h3>
    <h2>Good morning!</h2>
  37. 37.True or false: <li> has a closing tag. (a) True (b) False
  38. 38.📄 Where does <p> go: in the head or in the body? (a) in the body (b) in the head
  39. 39.🖼️ Which picture file does the browser load?
    <img src="kite.png" alt="A red kite" width="250">
    (a) A red kite (b) map.png (c) cake.jpg (d) kite.png
  40. 40.🔢 In a basic web page file, which comes first: “<!DOCTYPE html>” or “<html>”? (a) <!DOCTYPE html> (b) <html>

Answer key

  1. element
  2. Yes
  3. True
  4. <b>
  5. 6
  6. turns HTML into a page
  7. </b>
  8. a paragraph
  9. an opening tag
  10. Play games
  11. <h1>
  12. True
  13. 4
  14. An old fort
  15. <input>
  16. has an address bar
  17. Birthday cake
  18. No
  19. True
  20. an opening tag
  21. <head>
  22. <html>
  23. Welcome!
  24. width
  25. </p>
  26. False
  27. 2
  28. </b>
  29. </strong>
  30. 2
  31. 250
  32. about.html
  33. <li>
  34. a code editor
  35. <title>
  36. 4
  37. True
  38. in the body
  39. kite.png
  40. <!DOCTYPE html>

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