← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 829 · 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 is the closing tag for <b>? (a) <\b> (b) <b> (c) <b/> (d) </b>
  2. 2.🔢 In a basic web page file, which comes first: “<body>” or “<!DOCTYPE html>”? (a) <body> (b) <!DOCTYPE html>
  3. 3.🔠 How many headings are in this code?
    <h1>Rain today</h1>
    <h2>The red kite</h2>
    <p>Rain today</p>
    <h4>I love mangoes.</h4>
    <h3>Good morning!</h3>
  4. 4.Which of these is an opening tag? (a) </p> (b) <li> (c) </b> (d) </title>
  5. 5.🖼️ Does <img> need a closing tag? (a) Yes (b) No
  6. 6.True or false: <ul> shows bullet points. (a) False (b) True
  7. 7.📄 Where does the text of <title> appear? (a) nowhere (b) on the browser tab (c) in a big heading (d) at the bottom
  8. 8.🌐 Which one stores a website’s files? (a) a web browser (b) a web server (c) a code editor
  9. 9.Which of these goes in the head? (a) <h1> (b) <meta charset="utf-8"> (c) <a> (d) <table>
  10. 10.Which of these is true of a code editor? (a) saves our .html files (b) sends pages over the net (c) turns HTML into a page (d) hosts websites online
  11. 11.📄 Can HTML on its own make headings? (a) No (b) Yes
  12. 12.💬 How many paragraphs show on the page?
    <p>Rain today</p>
    <!-- <p>The red kite</p> -->
    <p>Cricket is fun.</p>
    <p>Fun facts</p>
  13. 13.📄 Where does <img> go: in the head or in the body? (a) in the body (b) in the head
  14. 14.🔗 Which words do you click on?
    <a href="art.html">School news</a>
    (a) href (b) Take the quiz (c) School news (d) art.html
  15. 15.📄 Which part holds everything you see on the page? (a) the title (b) the body (c) the doctype (d) the head
  16. 16.📋 Which tag goes around each item of a list? (a) <ol> (b) <li> (c) <ul> (d) <p>
  17. 17.🔍 One closing tag is missing. Which one?
    <h1>Fun facts</h1>
    <u>I love mangoes.</u>
    <h3>My best friend
    (a) </u> (b) </h1> (c) </h2> (d) </h3>
  18. 18.🏷️ What does a closing tag have that an opening tag does not? (a) a dot . (b) a hash # (c) a dollar $ (d) a slash /
  19. 19.📝 What does <hr> draw? (a) a picture (b) a link (c) a table (d) a line across the page
  20. 20.True or false: <table> goes in the head. (a) False (b) True
  21. 21.📝 Does <b> have a closing tag, or is it an empty tag? (a) has a closing tag (b) an empty tag
  22. 22.🖼️ Which attribute of <img> sets how wide it is? (a) height (b) alt (c) src (d) width
  23. 23.📋 What number does the browser show next to “Litchi”?
    <ol start="3">
      <li>Papaya</li>
      <li>Litchi</li>
      <li>Grapes</li>
      <li>Banana</li>
    </ol>
  24. 24.🔍 Which line is missing its closing tag?
    line 1: <small>The red kite</small>
    line 2: <h2>I love mangoes.</h2>
    line 3: <i>Hello, world!
    (a) line 1 (b) line 3 (c) line 2
  25. 25.🔍 Which is the odd one out? (a) sends pages over the net (b) stores a website’s files (c) colours code to help us (d) answers page requests
  26. 26.🔠 Which heading shows the BIGGEST text: <h1>, <h5>, <h6> or <h4>? (a) <h6> (b) <h5> (c) <h4> (d) <h1>
  27. 27.📄 What is the big heading shown on this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Space Facts</title>
    </head>
    <body>
      <h1>Easy snacks</h1>
      <p>Here is my best one.</p>
    </body>
    </html>
    (a) Here is my best one. (b) Easy snacks (c) body (d) Space Facts
  28. 28.🔗 Which address opens when you click this link?
    <a href="maths.html">School news</a>
    (a) art.html (b) School news (c) maths.html (d) news.html
  29. 29.🖼️ Which attribute of <img> sets how tall it is? (a) width (b) height (c) alt (d) src
  30. 30.True or false: <p> goes in the body. (a) True (b) False
  31. 31.🔗 Which address opens when you click this link?
    <a href="news.html">Maths fun</a>
    (a) games.html (b) Maths fun (c) news.html (d) quiz.html
  32. 32.📄 Where does <title> go: in the head or in the body? (a) in the head (b) in the body
  33. 33.🖼️ Why do we add alt text to an image? (a) to make it bigger (b) to describe the image (c) to colour it (d) to load it faster
  34. 34.True or false: in <img>, width sets how tall it is. (a) True (b) False
  35. 35.💬 How many paragraphs show on the page?
    <p>Good morning!</p>
    <!-- <p>Hello, world!</p> -->
    <p>Rain today</p>
    <p>The red kite</p>
    <p>My pets</p>
  36. 36.🔍 One closing tag is missing. Which one?
    <strong>My pets</strong>
    <em>I love mangoes.</em>
    <b>Cricket is fun.
    (a) </strong> (b) </b> (c) </em> (d) </small>
  37. 37.📝 You type 5 spaces between two words in a <p>. How does the browser show them? (a) as 5 spaces (b) as a new line (c) as one space (d) as a dot
  38. 38.📋 Which list suits a shopping list in any order? (a) <br> (b) <hr> (c) <ol> (d) <ul>
  39. 39.True or false: <ul> is an empty tag. (a) False (b) True
  40. 40.True or false: <ol> lists steps in order. (a) True (b) False

Answer key

  1. </b>
  2. <!DOCTYPE html>
  3. 4
  4. <li>
  5. No
  6. True
  7. on the browser tab
  8. a web server
  9. <meta charset="utf-8">
  10. saves our .html files
  11. Yes
  12. 3
  13. in the body
  14. School news
  15. the body
  16. <li>
  17. </h3>
  18. a slash /
  19. a line across the page
  20. False
  21. has a closing tag
  22. width
  23. 4
  24. line 3
  25. colours code to help us
  26. <h1>
  27. Easy snacks
  28. maths.html
  29. height
  30. True
  31. news.html
  32. in the head
  33. to describe the image
  34. False
  35. 4
  36. </b>
  37. as one space
  38. <ul>
  39. False
  40. True

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