← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 377 · 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 text will NOT show on the page?
    <p>Hello, world!</p>
    <p>Rain today</p>
    <!-- <p>My pets</p> -->
    (a) Hello, world! (b) Rain today (c) My pets
  2. 2.Which of these is an empty tag? (a) <h1> (b) <input> (c) <b> (d) <ul>
  3. 3.💬 How many paragraphs show on the page?
    <p>Hello, world!</p>
    <p>Fun facts</p>
    <!-- <p>I love mangoes.</p> -->
    <p>The red kite</p>
  4. 4.🔍 One closing tag is missing. Which one?
    <i>Rain today
    <h1>The red kite</h1>
    <u>My pets</u>
    (a) </h1> (b) </i> (c) </h2> (d) </u>
  5. 5.🔢 In a basic web page file, which comes first: “<!DOCTYPE html>” or “</head>”? (a) <!DOCTYPE html> (b) </head>
  6. 6.Which of these is true of a web browser? (a) hosts websites online (b) answers page requests (c) is where we type code (d) turns HTML into a page
  7. 7.🖼️ How many pixels wide is the picture drawn?
    <img src="kite.png" alt="A red kite" width="200">
  8. 8.🔠 How many <h1> headings should a page usually have? (a) 3 (b) 1 (c) 10 (d) 6
  9. 9.🔍 Which is the odd one out? (a) opens web pages for us (b) shows line numbers (c) colours code to help us (d) is where we type code
  10. 10.🔗 Which tag makes a clickable link? (a) <a> (b) <link> (c) <img> (d) <p>
  11. 11.💬 Which text will NOT show on the page?
    <!-- <p>Hello, world!</p> -->
    <p>I love mangoes.</p>
    <p>Cricket is fun.</p>
    (a) I love mangoes. (b) Hello, world! (c) Cricket is fun.
  12. 12.🔠 How many headings are in this code?
    <h1>Hello, world!</h1>
    <h4>My pets</h4>
    <h3>Rain today</h3>
    <h3>Hello, world!</h3>
    <p>Good morning!</p>
  13. 13.🔗 Which words do you click on?
    <a href="games.html">Contact us</a>
    (a) games.html (b) href (c) Visit the site (d) Contact us
  14. 14.🔍 Which line is missing its closing tag?
    line 1: <small>Fun facts</small>
    line 2: <b>Cricket is fun.</b>
    line 3: <u>The red kite
    (a) line 3 (b) line 1 (c) line 2
  15. 15.📄 Where does <img> go: in the head or in the body? (a) in the body (b) in the head
  16. 16.🔗 Which words do you click on?
    <a href="quiz.html">About us</a>
    (a) quiz.html (b) href (c) Contact us (d) About us
  17. 17.🖼️ How many pixels wide is the picture drawn?
    <img src="map.png" alt="Map of India" width="250">
  18. 18.🔢 In a basic web page file, which comes LAST? (a) <body> (b) </head> (c) </body> (d) </html>
  19. 19.🔠 How many headings are in this code?
    <h1>Cricket is fun.</h1>
    <p>I love mangoes.</p>
    <p>Fun facts</p>
    <p>My best friend</p>
  20. 20.🖼️ Which picture file does the browser load?
    <img src="cake.jpg" alt="Birthday cake" width="350">
    (a) moon.png (b) cake.jpg (c) Birthday cake (d) dog.jpg
  21. 21.📋 Which list tag is an unordered list? (a) <ol> (b) <ul> (c) <li>
  22. 22.🏷️ Which is the closing tag for <h1>? (a) <h1> (b) </h1> (c) <\h1> (d) <h1/>
  23. 23.📝 Does <meta> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
  24. 24.True or false: in <img>, src names the picture file. (a) True (b) False
  25. 25.🌐 Which one shows pages from the web? (a) a web browser (b) a web server (c) a code editor
  26. 26.🏷️ Is </h1> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
  27. 27.🔗 Which attribute holds the address of a link? (a) src (b) alt (c) href (d) id
  28. 28.💬 How does an HTML comment start? (a) <!-- (b) /* (c) # (d) //
  29. 29.📋 Does this list show bullets or numbers?
    <ul>
      <li>Guava</li>
      <li>Jamun</li>
    </ul>
    (a) numbers (b) bullets
  30. 30.📛 In <a href="x.html">, what is href? (a) an attribute (b) a closing tag (c) a comment (d) an element name
  31. 31.💬 Can anyone read your comments by viewing the page source? (a) No (b) Yes
  32. 32.📋 Does this list show bullets or numbers?
    <ol>
      <li>Guava</li>
      <li>Orange</li>
    </ol>
    (a) numbers (b) bullets
  33. 33.🖼️ Does <img> need a closing tag? (a) No (b) Yes
  34. 34.🔠 Which heading shows the BIGGEST text: <h5>, <h2>, <h3> or <h6>? (a) <h2> (b) <h6> (c) <h3> (d) <h5>
  35. 35.True or false: <ol> lists steps in order. (a) False (b) True
  36. 36.True or false: <h1> goes in the body. (a) False (b) True
  37. 37.🔍 Which is the odd one out? (a) answers page requests (b) shows line numbers (c) sends pages over the net (d) hosts websites online
  38. 38.📝 How many paragraphs does this code make?
    <p>The red kite</p>
    <p>The red kite</p>
    <p>Fun facts</p>
    <p>The red kite</p>
    <p>Hello, world!</p>
    <h2>The red kite</h2>
  39. 39.💬 How does an HTML comment end? (a) // (b) >> (c) --> (d) */
  40. 40.💬 Why do coders write comments? (a) to add colour (b) to make links (c) to leave notes (d) to show pictures

Answer key

  1. My pets
  2. <input>
  3. 3
  4. </i>
  5. <!DOCTYPE html>
  6. turns HTML into a page
  7. 200
  8. 1
  9. opens web pages for us
  10. <a>
  11. Hello, world!
  12. 4
  13. Contact us
  14. line 3
  15. in the body
  16. About us
  17. 250
  18. </html>
  19. 1
  20. cake.jpg
  21. <ul>
  22. </h1>
  23. an empty tag
  24. True
  25. a web browser
  26. a closing tag
  27. href
  28. <!--
  29. bullets
  30. an attribute
  31. Yes
  32. numbers
  33. No
  34. <h2>
  35. True
  36. True
  37. shows line numbers
  38. 5
  39. -->
  40. to leave notes

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