← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 771 · 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 has a closing tag? (a) <img> (b) <br> (c) <p> (d) <meta>
  2. 2.🏷️ Is <li> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
  3. 3.🔍 Which line is missing its closing tag?
    line 1: <u>The red kite</u>
    line 2: <strong>Cricket is fun.</strong>
    line 3: <em>Good morning!
    (a) line 2 (b) line 1 (c) line 3
  4. 4.🏷️ What does a closing tag have that an opening tag does not? (a) a slash / (b) a hash # (c) a dot . (d) a dollar $
  5. 5.True or false: in <img>, src describes the picture. (a) False (b) True
  6. 6.🖼️ Why do we add alt text to an image? (a) to make it bigger (b) to load it faster (c) to describe the image (d) to colour it
  7. 7.🖼️ How many pixels wide is the picture drawn?
    <img src="bus.jpg" alt="Our school bus" width="100">
  8. 8.🔠 Which heading shows the BIGGEST text: <h4>, <h6>, <h3> or <h2>? (a) <h6> (b) <h4> (c) <h2> (d) <h3>
  9. 9.Which of these is true of a web server? (a) shows pages from the web (b) has an address bar (c) hosts websites online (d) opens web pages for us
  10. 10.🖼️ Which attribute of <img> sets how wide it is? (a) src (b) width (c) height (d) alt
  11. 11.📝 How many paragraphs does this code make?
    <p>Rain today</p>
    <p>Rain today</p>
    <p>Good morning!</p>
  12. 12.Which of these goes in the head? (a) <img> (b) <h1> (c) <ul> (d) <title>
  13. 13.📄 What does the browser tab show for this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Class 7 Blog</title>
    </head>
    <body>
      <h1>Planets</h1>
      <p>Thanks for visiting.</p>
    </body>
    </html>
    (a) Thanks for visiting. (b) index.html (c) Planets (d) Class 7 Blog
  14. 14.Which of these is a closing tag? (a) <body> (b) <p> (c) </b> (d) <li>
  15. 15.📝 On how many lines does the browser show this paragraph?
    <p>Roses are red<br>Rivers flow</p>
  16. 16.🖼️ Which attribute of <img> names the picture file? (a) width (b) height (c) alt (d) src
  17. 17.🔍 Which is the odd one out? (a) saves our .html files (b) sends pages over the net (c) is where we type code (d) shows line numbers
  18. 18.Which of these is an empty tag? (a) <li> (b) <p> (c) <ul> (d) <hr>
  19. 19.📝 On how many lines does the browser show this paragraph?
    <p>Sky is blue<br>Birds sing</p>
  20. 20.💬 How many paragraphs show on the page?
    <p>My pets</p>
    <p>Fun facts</p>
    <!-- <p>Hello, world!</p> -->
  21. 21.🔠 How many headings are in this code?
    <h1>Our school trip</h1>
    <h4>The red kite</h4>
    <h2>Hello, world!</h2>
    <p>My pets</p>
  22. 22.🔗 Which attribute holds the address of a link? (a) href (b) src (c) id (d) alt
  23. 23.📝 How many paragraphs does this code make?
    <p>Hello, world!</p>
    <p>Cricket is fun.</p>
    <p>Good morning!</p>
    <h2>My best friend</h2>
    <p>Rain today</p>
    <p>Our school trip</p>
  24. 24.True or false: <li> lists things in any order. (a) False (b) True
  25. 25.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="fort.jpg" alt="An old fort" width="150">
    (a) width (b) A tiger asleep (c) An old fort (d) fort.jpg
  26. 26.🖼️ Which picture file does the browser load?
    <img src="tiger.jpg" alt="A tiger asleep" width="400">
    (a) A tiger asleep (b) kite.png (c) tiger.jpg (d) map.png
  27. 27.🖼️ Which attribute of <img> tells which image to load? (a) width (b) height (c) src (d) alt
  28. 28.💬 How many paragraphs show on the page?
    <p>Cricket is fun.</p>
    <!-- <p>I love mangoes.</p> -->
    <!-- <p>Rain today</p> -->
    <!-- <p>Our school trip</p> -->
    <p>The red kite</p>
  29. 29.📋 Does this list show bullets or numbers?
    <ul>
      <li>Mango</li>
      <li>Orange</li>
      <li>Litchi</li>
    </ul>
    (a) numbers (b) bullets
  30. 30.📋 What number does the browser show next to “Papaya”?
    <ol>
      <li>Guava</li>
      <li>Papaya</li>
      <li>Mango</li>
    </ol>
  31. 31.🔗 Where does this link open?
    <a href="games.html">Play games</a>
    (a) in the same tab (b) in a new tab
  32. 32.💬 How does an HTML comment start? (a) <!-- (b) // (c) /* (d) #
  33. 33.📝 On how many lines does the browser show this paragraph?
    <p>Birds sing<br>Stars shine<br>Kites fly high<br>Sky is blue</p>
  34. 34.🔍 One closing tag is missing. Which one?
    <u>Hello, world!
    <p>Cricket is fun.</p>
    <i>Fun facts</i>
    (a) </u> (b) </h1> (c) </i> (d) </p>
  35. 35.💬 Which text will NOT show on the page?
    <!-- <p>Cricket is fun.</p> -->
    <p>Good morning!</p>
    <p>My pets</p>
    (a) Cricket is fun. (b) My pets (c) Good morning!
  36. 36.True or false: in <img>, width sets how wide it is. (a) True (b) False
  37. 37.📋 Which list suits a shopping list in any order? (a) <hr> (b) <ul> (c) <br> (d) <ol>
  38. 38.📋 How many items does this list show?
    <ul>
      <li>Mango</li>
      <li>Grapes</li>
      <li>Orange</li>
      <li>Banana</li>
      <li>Papaya</li>
      <li>Litchi</li>
    </ul>
  39. 39.📋 How many items does this list show?
    <ol>
      <li>Jamun</li>
      <li>Banana</li>
      <li>Orange</li>
      <li>Mango</li>
      <li>Litchi</li>
    </ol>
  40. 40.💬 Which text will NOT show on the page?
    <!-- <p>Good morning!</p> -->
    <p>Hello, world!</p>
    <p>My pets</p>
    (a) Good morning! (b) My pets (c) Hello, world!

Answer key

  1. <p>
  2. an opening tag
  3. line 3
  4. a slash /
  5. False
  6. to describe the image
  7. 100
  8. <h2>
  9. hosts websites online
  10. width
  11. 3
  12. <title>
  13. Class 7 Blog
  14. </b>
  15. 2
  16. src
  17. sends pages over the net
  18. <hr>
  19. 2
  20. 2
  21. 3
  22. href
  23. 5
  24. False
  25. An old fort
  26. tiger.jpg
  27. src
  28. 2
  29. bullets
  30. 2
  31. in the same tab
  32. <!--
  33. 4
  34. </u>
  35. Cricket is fun.
  36. True
  37. <ul>
  38. 6
  39. 5
  40. Good morning!

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