← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 752 · 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.📝 Does <p> have a closing tag, or is it an empty tag? (a) has a closing tag (b) an empty tag
  2. 2.True or false: <li> is an empty tag. (a) True (b) False
  3. 3.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="map.png" alt="Map of India" width="100">
    (a) Map of India (b) Birthday cake (c) width (d) map.png
  4. 4.💬 Which text will NOT show on the page?
    <p>Rain today</p>
    <p>The red kite</p>
    <!-- <p>Hello, world!</p> -->
    (a) The red kite (b) Hello, world! (c) Rain today
  5. 5.🏷️ Which is the closing tag for <h3>? (a) <h3> (b) </h3> (c) <\h3> (d) <h3/>
  6. 6.🌐 Which one turns HTML into a page? (a) a code editor (b) a web browser (c) a web server
  7. 7.🖼️ Which attribute of <img> sets how wide it is? (a) alt (b) height (c) width (d) src
  8. 8.🔠 How many headings are in this code?
    <h1>Good morning!</h1>
    <p>Our school trip</p>
    <h4>My best friend</h4>
    <p>The red kite</p>
    <p>I love mangoes.</p>
  9. 9.📄 Where does the text of <title> appear? (a) in a big heading (b) on the browser tab (c) at the bottom (d) nowhere
  10. 10.📋 How many items does this list show?
    <ol>
      <li>Mango</li>
      <li>Orange</li>
      <li>Litchi</li>
      <li>Jamun</li>
      <li>Papaya</li>
    </ol>
  11. 11.📝 How many paragraphs does this code make?
    <p>The red kite</p>
    <h2>Hello, world!</h2>
    <p>Fun facts</p>
    <p>I love mangoes.</p>
  12. 12.True or false: in <img>, src sets how tall it is. (a) True (b) False
  13. 13.🔍 Which line is missing its closing tag?
    line 1: <strong>Cricket is fun.
    line 2: <small>Fun facts</small>
    line 3: <u>I love mangoes.</u>
    (a) line 1 (b) line 3 (c) line 2
  14. 14.🖼️ How many pixels wide is the picture drawn?
    <img src="cake.jpg" alt="Birthday cake" width="300">
  15. 15.🏷️ What does a closing tag have that an opening tag does not? (a) a dot . (b) a slash / (c) a dollar $ (d) a hash #
  16. 16.🏷️ Is </b> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
  17. 17.🔍 One closing tag is missing. Which one?
    <strong>Our school trip</strong>
    <i>Fun facts
    <b>My best friend</b>
    (a) </b> (b) </i> (c) </h1> (d) </strong>
  18. 18.🖼️ Which picture file does the browser load?
    <img src="kite.png" alt="A red kite" width="200">
    (a) map.png (b) cake.jpg (c) A red kite (d) kite.png
  19. 19.🔠 How many heading levels does HTML have? (a) 6 (b) 4 (c) 3 (d) 10
  20. 20.🖼️ How many pixels wide is the picture drawn?
    <img src="map.png" alt="Map of India" width="400">
  21. 21.📝 On how many lines does the browser show this paragraph?
    <p>Kites fly high<br>Sky is blue</p>
  22. 22.🔠 Which heading shows the SMALLEST text: <h4>, <h1>, <h2> or <h3>? (a) <h1> (b) <h3> (c) <h4> (d) <h2>
  23. 23.🔠 How many headings are in this code?
    <h1>Rain today</h1>
    <h4>Hello, world!</h4>
    <h3>Hello, world!</h3>
    <p>My pets</p>
    <p>Fun facts</p>
  24. 24.True or false: in <img>, src sets how wide it is. (a) False (b) True
  25. 25.📄 What is the first line of an HTML5 page? (a) <html> (b) <head> (c) <body> (d) <!DOCTYPE html>
  26. 26.📋 What number does the browser show next to “Jamun”?
    <ol start="9">
      <li>Banana</li>
      <li>Jamun</li>
      <li>Litchi</li>
      <li>Papaya</li>
      <li>Guava</li>
    </ol>
  27. 27.🔗 Which address opens when you click this link?
    <a href="contact.html">School news</a>
    (a) School news (b) contact.html (c) maths.html (d) https://example.com
  28. 28.🔗 Which address opens when you click this link?
    <a href="art.html">Take the quiz</a>
    (a) quiz.html (b) news.html (c) art.html (d) Take the quiz
  29. 29.🔗 Which address opens when you click this link?
    <a href="games.html">Visit the site</a>
    (a) Visit the site (b) contact.html (c) games.html (d) about.html
  30. 30.🖼️ Which attribute of <img> sets how tall it is? (a) alt (b) width (c) height (d) src
  31. 31.Which of these goes in the head? (a) <h1> (b) <a> (c) <ul> (d) <meta charset="utf-8">
  32. 32.🏷️ Which is the closing tag for <u>? (a) <u/> (b) <\u> (c) <u> (d) </u>
  33. 33.📄 Where does <title> go: in the head or in the body? (a) in the head (b) in the body
  34. 34.🖼️ How many pixels wide is the picture drawn?
    <img src="moon.png" alt="The full moon" width="150">
  35. 35.🔠 Which heading shows the SMALLEST text: <h2>, <h6>, <h5> or <h3>? (a) <h6> (b) <h5> (c) <h3> (d) <h2>
  36. 36.🔍 Which line is missing its closing tag?
    line 1: <h2>Our school trip</h2>
    line 2: <b>Cricket is fun.
    line 3: <u>I love mangoes.</u>
    (a) line 2 (b) line 3 (c) line 1
  37. 37.True or false: <li> goes inside ul or ol. (a) True (b) False
  38. 38.🔍 One closing tag is missing. Which one?
    <h3>My best friend
    <strong>I love mangoes.</strong>
    <i>The red kite</i>
    (a) </h2> (b) </h3> (c) </strong> (d) </i>
  39. 39.Which of these is an opening tag? (a) </p> (b) <body> (c) </li> (d) </title>
  40. 40.🔍 One closing tag is missing. Which one?
    <i>My pets</i>
    <small>My best friend</small>
    <h2>Fun facts
    (a) </small> (b) </h2> (c) </h3> (d) </i>

Answer key

  1. has a closing tag
  2. False
  3. Map of India
  4. Hello, world!
  5. </h3>
  6. a web browser
  7. width
  8. 2
  9. on the browser tab
  10. 5
  11. 3
  12. False
  13. line 1
  14. 300
  15. a slash /
  16. a closing tag
  17. </i>
  18. kite.png
  19. 6
  20. 400
  21. 2
  22. <h4>
  23. 3
  24. False
  25. <!DOCTYPE html>
  26. 10
  27. contact.html
  28. art.html
  29. games.html
  30. height
  31. <meta charset="utf-8">
  32. </u>
  33. in the head
  34. 150
  35. <h6>
  36. line 2
  37. True
  38. </h3>
  39. <body>
  40. </h2>

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