← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 508 · 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 heading shows the SMALLEST text: <h2>, <h3>, <h4> or <h5>? (a) <h5> (b) <h2> (c) <h3> (d) <h4>
  2. 2.🏷️ Is </li> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
  3. 3.True or false: in <img>, width names the picture file. (a) False (b) True
  4. 4.🖼️ Which picture file does the browser load?
    <img src="kite.png" alt="A red kite" width="200">
    (a) cake.jpg (b) map.png (c) kite.png (d) A red kite
  5. 5.🖼️ Which picture file does the browser load?
    <img src="bus.jpg" alt="Our school bus" width="200">
    (a) bus.jpg (b) fort.jpg (c) tiger.jpg (d) Our school bus
  6. 6.🌐 Which one answers page requests? (a) a code editor (b) a web browser (c) a web server
  7. 7.Which of these is an empty tag? (a) <b> (b) <p> (c) <li> (d) <meta>
  8. 8.🏷️ Which is the closing tag for <i>? (a) <i> (b) </i> (c) <i/> (d) <\i>
  9. 9.True or false: in <img>, src shows if the image fails. (a) True (b) False
  10. 10.True or false: in <img>, width sets how wide it is. (a) False (b) True
  11. 11.📝 What does <br> do? (a) makes text bold (b) adds a picture (c) makes a list (d) starts a new line
  12. 12.📝 How many paragraphs does this code make?
    <p>My best friend</p>
    <h2>Cricket is fun.</h2>
    <p>Hello, world!</p>
    <p>Rain today</p>
  13. 13.📄 Which part holds everything you see on the page? (a) the title (b) the body (c) the doctype (d) the head
  14. 14.🧩 An opening tag + content + a closing tag together make an ___. (a) attribute (b) address (c) editor (d) element
  15. 15.🔠 How many heading levels does HTML have? (a) 4 (b) 3 (c) 10 (d) 6
  16. 16.🔗 Which code links to about.html? (a) <a src="about.html"> (b) <a alt="about.html"> (c) <link about.html> (d) <a href="about.html">
  17. 17.📄 Where does <style> go: in the head or in the body? (a) in the head (b) in the body
  18. 18.💬 Which text will NOT show on the page?
    <p>My pets</p>
    <p>Good morning!</p>
    <p>Our school trip</p>
    <!-- <p>The red kite</p> -->
    (a) Our school trip (b) The red kite (c) My pets (d) Good morning!
  19. 19.💬 Why do coders write comments? (a) to show pictures (b) to leave notes (c) to add colour (d) to make links
  20. 20.🔍 Which line is missing its closing tag?
    line 1: <p>My pets
    line 2: <b>Fun facts</b>
    line 3: <h2>The red kite</h2>
    (a) line 3 (b) line 1 (c) line 2
  21. 21.🔠 Which tag is used for the main title on a page? (a) <br> (b) <h6> (c) <h1> (d) <p>
  22. 22.🖼️ How many pixels wide is the picture drawn?
    <img src="dog.jpg" alt="A happy dog" width="100">
  23. 23.🔠 How many headings are in this code?
    <h1>Hello, world!</h1>
    <h2>Cricket is fun.</h2>
    <p>Fun facts</p>
  24. 24.Which of these goes in the head? (a) <link rel="stylesheet"> (b) <h1> (c) <ul> (d) <a>
  25. 25.📝 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 new line (d) as a dot
  26. 26.📄 Where does <h1> go: in the head or in the body? (a) in the body (b) in the head
  27. 27.🔍 Which is the odd one out? (a) colours code to help us (b) is where we type code (c) opens web pages for us (d) saves our .html files
  28. 28.True or false: in <img>, src tells which image to load. (a) False (b) True
  29. 29.📝 How many paragraphs does this code make?
    <p>The red kite</p>
    <p>Rain today</p>
    <h2>The red kite</h2>
    <h2>Good morning!</h2>
    <p>I love mangoes.</p>
    <h2>Fun facts</h2>
  30. 30.🔗 Which address opens when you click this link?
    <a href="games.html">Art corner</a>
    (a) about.html (b) Art corner (c) contact.html (d) games.html
  31. 31.🖼️ How many pixels wide is the picture drawn?
    <img src="tiger.jpg" alt="A tiger asleep" width="50">
  32. 32.📋 Which list tag is an ordered list? (a) <ol> (b) <li> (c) <ul>
  33. 33.📝 Does <li> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
  34. 34.Which of these is a closing tag? (a) </b> (b) <li> (c) <p> (d) <title>
  35. 35.📋 How many items does this list show?
    <ul>
      <li>Grapes</li>
      <li>Litchi</li>
      <li>Banana</li>
      <li>Guava</li>
      <li>Jamun</li>
      <li>Mango</li>
    </ul>
  36. 36.🔗 Which attribute holds the address of a link? (a) id (b) src (c) alt (d) href
  37. 37.💬 Which text will NOT show on the page?
    <p>Rain today</p>
    <p>Hello, world!</p>
    <!-- <p>I love mangoes.</p> -->
    (a) Hello, world! (b) I love mangoes. (c) Rain today
  38. 38.💬 How many paragraphs show on the page?
    <!-- <p>Hello, world!</p> -->
    <p>Cricket is fun.</p>
    <p>Our school trip</p>
    <!-- <p>My pets</p> -->
    <p>I love mangoes.</p>
  39. 39.🔍 One closing tag is missing. Which one?
    <strong>I love mangoes.
    <em>Our school trip</em>
    <i>My pets</i>
    (a) </em> (b) </i> (c) </strong> (d) </b>
  40. 40.💬 Which text will NOT show on the page?
    <!-- <p>My pets</p> -->
    <p>Hello, world!</p>
    <p>I love mangoes.</p>
    (a) Hello, world! (b) My pets (c) I love mangoes.

Answer key

  1. <h5>
  2. a closing tag
  3. False
  4. kite.png
  5. bus.jpg
  6. a web server
  7. <meta>
  8. </i>
  9. False
  10. True
  11. starts a new line
  12. 3
  13. the body
  14. element
  15. 6
  16. <a href="about.html">
  17. in the head
  18. The red kite
  19. to leave notes
  20. line 1
  21. <h1>
  22. 100
  23. 2
  24. <link rel="stylesheet">
  25. as one space
  26. in the body
  27. opens web pages for us
  28. True
  29. 3
  30. games.html
  31. 50
  32. <ol>
  33. has a closing tag
  34. </b>
  35. 6
  36. href
  37. I love mangoes.
  38. 3
  39. </strong>
  40. My pets

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