← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 240 · 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.📝 On how many lines does the browser show this paragraph?
    <p>Birds sing<br>Stars shine<br>Rivers flow<br>Roses are red<br>Sky is blue</p>
  2. 2.📄 Where does <meta charset="utf-8"> go: in the head or in the body? (a) in the body (b) in the head
  3. 3.True or false: <ul> goes in the body. (a) False (b) True
  4. 4.💬 How does an HTML comment start? (a) // (b) # (c) /* (d) <!--
  5. 5.Which of these is an empty tag? (a) <b> (b) <img> (c) <li> (d) <title>
  6. 6.🏷️ Which is the closing tag for <i>? (a) <i/> (b) <\i> (c) </i> (d) <i>
  7. 7.📝 On how many lines does the browser show this paragraph?
    <p>Roses are red<br>Birds sing<br>Sky is blue</p>
  8. 8.🏷️ Which is the closing tag for <u>? (a) <\u> (b) <u/> (c) </u> (d) <u>
  9. 9.📋 Which list tag is one item of a list? (a) <li> (b) <ul> (c) <ol>
  10. 10.🖼️ Which tag puts a picture on a page? (a) <img> (b) <a> (c) <p> (d) <pic>
  11. 11.🖼️ Which attribute of <img> names the picture file? (a) alt (b) height (c) width (d) src
  12. 12.📄 Where does <style> go: in the head or in the body? (a) in the head (b) in the body
  13. 13.📋 Does this list show bullets or numbers?
    <ul>
      <li>Banana</li>
      <li>Mango</li>
      <li>Guava</li>
    </ul>
    (a) bullets (b) numbers
  14. 14.🔍 Which line is missing its closing tag?
    line 1: <h1>Hello, world!</h1>
    line 2: <h2>Our school trip</h2>
    line 3: <i>The red kite
    (a) line 2 (b) line 1 (c) line 3
  15. 15.Which of these is true of a code editor? (a) answers page requests (b) is where we type code (c) shows pages from the web (d) sends pages over the net
  16. 16.🔠 How many heading levels does HTML have? (a) 10 (b) 6 (c) 4 (d) 3
  17. 17.📄 Can HTML on its own show paragraphs? (a) Yes (b) No
  18. 18.True or false: <input> has a closing tag. (a) True (b) False
  19. 19.💬 How many paragraphs show on the page?
    <p>The red kite</p>
    <!-- <p>My pets</p> -->
    <p>Rain today</p>
    <!-- <p>I love mangoes.</p> -->
    <p>Hello, world!</p>
  20. 20.🖼️ How many pixels wide is the picture drawn?
    <img src="tiger.jpg" alt="A tiger asleep" width="200">
  21. 21.🔍 Which line is missing its closing tag?
    line 1: <small>I love mangoes.</small>
    line 2: <h3>Rain today
    line 3: <i>The red kite</i>
    (a) line 1 (b) line 2 (c) line 3
  22. 22.🔠 Which heading shows the SMALLEST text: <h4>, <h3>, <h5> or <h6>? (a) <h3> (b) <h5> (c) <h4> (d) <h6>
  23. 23.📋 What number does the browser show next to “Orange”?
    <ol>
      <li>Mango</li>
      <li>Orange</li>
      <li>Papaya</li>
    </ol>
  24. 24.📋 What number does the browser show next to “Guava”?
    <ol start="7">
      <li>Banana</li>
      <li>Guava</li>
      <li>Jamun</li>
      <li>Papaya</li>
    </ol>
  25. 25.🔍 One closing tag is missing. Which one?
    <strong>I love mangoes.</strong>
    <p>The red kite</p>
    <i>My pets
    (a) </p> (b) </i> (c) </strong> (d) </h3>
  26. 26.🔍 One closing tag is missing. Which one?
    <strong>My best friend
    <u>The red kite</u>
    <i>I love mangoes.</i>
    (a) </i> (b) </strong> (c) </h2> (d) </u>
  27. 27.🏷️ What does a closing tag have that an opening tag does not? (a) a dollar $ (b) a hash # (c) a dot . (d) a slash /
  28. 28.📄 What is the first line of an HTML5 page? (a) <body> (b) <!DOCTYPE html> (c) <head> (d) <html>
  29. 29.🔗 What does target="_blank" do to a link? (a) makes it blank (b) opens it in a new tab (c) hides the link (d) makes it bold
  30. 30.🔠 How many headings are in this code?
    <h1>Cricket is fun.</h1>
    <h3>The red kite</h3>
    <h2>Good morning!</h2>
    <p>My best friend</p>
    <h4>Good morning!</h4>
  31. 31.True or false: in <img>, width names the picture file. (a) True (b) False
  32. 32.📝 What do we need to write HTML? (a) a microphone (b) a paintbrush (c) a plain text editor (d) a printer
  33. 33.🖼️ Which attribute of <img> is read by screen readers? (a) src (b) height (c) alt (d) width
  34. 34.🔍 One closing tag is missing. Which one?
    <b>Rain today</b>
    <u>Cricket is fun.</u>
    <em>My pets
    (a) </b> (b) </h1> (c) </u> (d) </em>
  35. 35.🔠 Are headings shown in bold by default? (a) Yes (b) No
  36. 36.True or false: in <img>, height sets how wide it is. (a) True (b) False
  37. 37.Which of these is an opening tag? (a) </li> (b) </h1> (c) <title> (d) </body>
  38. 38.🔗 Which address opens when you click this link?
    <a href="quiz.html">Contact us</a>
    (a) games.html (b) about.html (c) quiz.html (d) Contact us
  39. 39.💬 Which text will NOT show on the page?
    <p>My best friend</p>
    <!-- <p>Good morning!</p> -->
    <p>My pets</p>
    (a) Good morning! (b) My best friend (c) My pets
  40. 40.📋 Does this list show bullets or numbers?
    <ul>
      <li>Guava</li>
      <li>Litchi</li>
      <li>Orange</li>
    </ul>
    (a) bullets (b) numbers

Answer key

  1. 5
  2. in the head
  3. True
  4. <!--
  5. <img>
  6. </i>
  7. 3
  8. </u>
  9. <li>
  10. <img>
  11. src
  12. in the head
  13. bullets
  14. line 3
  15. is where we type code
  16. 6
  17. Yes
  18. False
  19. 3
  20. 200
  21. line 2
  22. <h6>
  23. 2
  24. 8
  25. </i>
  26. </strong>
  27. a slash /
  28. <!DOCTYPE html>
  29. opens it in a new tab
  30. 4
  31. False
  32. a plain text editor
  33. alt
  34. </em>
  35. Yes
  36. False
  37. <title>
  38. quiz.html
  39. Good morning!
  40. bullets

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