← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 214 · 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 of these goes in the head? (a) <table> (b) <style> (c) <p> (d) <h1>
  2. 2.🔢 In a basic web page file, which comes FIRST? (a) </head> (b) <body> (c) <!DOCTYPE html> (d) </body>
  3. 3.🔗 Which words do you click on?
    <a href="art.html">About us</a>
    (a) href (b) About us (c) Contact us (d) art.html
  4. 4.🔗 Which attribute holds the address of a link? (a) alt (b) href (c) id (d) src
  5. 5.True or false: <link rel="stylesheet"> goes in the head. (a) False (b) True
  6. 6.Which of these has a closing tag? (a) <meta> (b) <img> (c) <b> (d) <input>
  7. 7.True or false: <li> is one item of a list. (a) False (b) True
  8. 8.🔗 What does target="_blank" do to a link? (a) makes it bold (b) opens it in a new tab (c) makes it blank (d) hides the link
  9. 9.📋 How many items does this list show?
    <ol>
      <li>Grapes</li>
      <li>Orange</li>
      <li>Litchi</li>
    </ol>
  10. 10.💬 How many paragraphs show on the page?
    <p>Hello, world!</p>
    <p>My pets</p>
    <p>Fun facts</p>
    <!-- <p>I love mangoes.</p> -->
    <!-- <p>Cricket is fun.</p> -->
  11. 11.🔍 Which line is missing its closing tag?
    line 1: <strong>Good morning!
    line 2: <p>Hello, world!</p>
    line 3: <em>The red kite</em>
    (a) line 2 (b) line 3 (c) line 1
  12. 12.🔗 Where does this link open?
    <a href="about.html">Contact us</a>
    (a) in a new tab (b) in the same tab
  13. 13.📄 What does the browser tab show for this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Space Facts</title>
    </head>
    <body>
      <h1>Easy snacks</h1>
      <p>I like to read.</p>
    </body>
    </html>
    (a) Space Facts (b) I like to read. (c) index.html (d) Easy snacks
  14. 14.🔠 Which heading shows the BIGGEST text: <h1>, <h6>, <h2> or <h4>? (a) <h2> (b) <h1> (c) <h6> (d) <h4>
  15. 15.📝 You type 5 spaces between two words in a <p>. How does the browser show them? (a) as one space (b) as 5 spaces (c) as a dot (d) as a new line
  16. 16.🔠 How many headings are in this code?
    <h1>My best friend</h1>
    <h2>Our school trip</h2>
    <p>Rain today</p>
    <p>Cricket is fun.</p>
    <p>Fun facts</p>
  17. 17.🔍 Which is the odd one out? (a) turns HTML into a page (b) stores a website’s files (c) hosts websites online (d) sends pages over the net
  18. 18.🔗 Where does this link open?
    <a href="quiz.html" target="_blank">About us</a>
    (a) in the same tab (b) in a new tab
  19. 19.📄 Can HTML on its own show paragraphs? (a) Yes (b) No
  20. 20.Which of these is an opening tag? (a) </h1> (b) </p> (c) <body> (d) </b>
  21. 21.📝 Does <ul> have a closing tag, or is it an empty tag? (a) has a closing tag (b) an empty tag
  22. 22.🔍 Which line is missing its closing tag?
    line 1: <em>Cricket is fun.</em>
    line 2: <strong>My best friend
    line 3: <h3>Hello, world!</h3>
    (a) line 3 (b) line 2 (c) line 1
  23. 23.📋 Which list suits a shopping list in any order? (a) <br> (b) <ol> (c) <hr> (d) <ul>
  24. 24.🖼️ Which attribute of <img> describes the picture? (a) height (b) alt (c) src (d) width
  25. 25.💬 How many paragraphs show on the page?
    <!-- <p>Hello, world!</p> -->
    <!-- <p>Rain today</p> -->
    <!-- <p>Good morning!</p> -->
    <!-- <p>Cricket is fun.</p> -->
    <p>The red kite</p>
  26. 26.🔠 Which heading shows the SMALLEST text: <h4>, <h3>, <h2> or <h6>? (a) <h2> (b) <h4> (c) <h6> (d) <h3>
  27. 27.Which of these is a closing tag? (a) </title> (b) <li> (c) <title> (d) <body>
  28. 28.True or false: in <img>, width tells which image to load. (a) True (b) False
  29. 29.📄 Where does <meta charset="utf-8"> go: in the head or in the body? (a) in the head (b) in the body
  30. 30.🔍 Which line is missing its closing tag?
    line 1: <h2>My best friend</h2>
    line 2: <em>Hello, world!</em>
    line 3: <i>Good morning!
    (a) line 2 (b) line 3 (c) line 1
  31. 31.💬 How many paragraphs show on the page?
    <p>Our school trip</p>
    <!-- <p>Cricket is fun.</p> -->
    <p>My pets</p>
    <p>Good morning!</p>
  32. 32.🖼️ Which attribute of <img> names the picture file? (a) width (b) height (c) alt (d) src
  33. 33.🔠 Which heading shows the BIGGEST text: <h2>, <h4>, <h1> or <h6>? (a) <h2> (b) <h4> (c) <h6> (d) <h1>
  34. 34.📄 Which part holds everything you see on the page? (a) the head (b) the body (c) the doctype (d) the title
  35. 35.📄 What is the big heading shown on this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>My Hobbies</title>
    </head>
    <body>
      <h1>Easy snacks</h1>
      <p>Try this poha.</p>
    </body>
    </html>
    (a) body (b) Easy snacks (c) Try this poha. (d) My Hobbies
  36. 36.🏷️ HTML marks up text using ___. (a) keys (b) wires (c) pixels (d) tags
  37. 37.🧩 An opening tag + content + a closing tag together make an ___. (a) editor (b) element (c) address (d) attribute
  38. 38.📝 What does <br> do? (a) makes a list (b) adds a picture (c) makes text bold (d) starts a new line
  39. 39.🔗 Which address opens when you click this link?
    <a href="about.html">Art corner</a>
    (a) Art corner (b) about.html (c) https://example.com (d) contact.html
  40. 40.True or false: <table> goes in the head. (a) True (b) False

Answer key

  1. <style>
  2. <!DOCTYPE html>
  3. About us
  4. href
  5. True
  6. <b>
  7. True
  8. opens it in a new tab
  9. 3
  10. 3
  11. line 1
  12. in the same tab
  13. Space Facts
  14. <h1>
  15. as one space
  16. 2
  17. turns HTML into a page
  18. in a new tab
  19. Yes
  20. <body>
  21. has a closing tag
  22. line 2
  23. <ul>
  24. alt
  25. 1
  26. <h6>
  27. </title>
  28. False
  29. in the head
  30. line 3
  31. 3
  32. src
  33. <h1>
  34. the body
  35. Easy snacks
  36. tags
  37. element
  38. starts a new line
  39. about.html
  40. False

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