← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 180 · 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.True or false: a web browser saves our .html files. (a) True (b) False
  2. 2.🖼️ Which attribute of <img> names the picture file? (a) alt (b) height (c) src (d) width
  3. 3.📄 What does the browser tab show for this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Class 7 Blog</title>
    </head>
    <body>
      <h1>Match report</h1>
      <p>Try this poha.</p>
    </body>
    </html>
    (a) Try this poha. (b) Class 7 Blog (c) index.html (d) Match report
  4. 4.🔠 Which heading shows the BIGGEST text: <h5>, <h4>, <h2> or <h1>? (a) <h4> (b) <h2> (c) <h1> (d) <h5>
  5. 5.🔠 Which heading shows the BIGGEST text: <h1>, <h2>, <h6> or <h5>? (a) <h6> (b) <h2> (c) <h5> (d) <h1>
  6. 6.📋 What number does the browser show next to “Grapes”?
    <ol start="4">
      <li>Guava</li>
      <li>Mango</li>
      <li>Grapes</li>
    </ol>
  7. 7.🔠 Which heading shows the BIGGEST text: <h6>, <h2>, <h1> or <h4>? (a) <h4> (b) <h1> (c) <h6> (d) <h2>
  8. 8.True or false: a code editor turns HTML into a page. (a) False (b) True
  9. 9.🏷️ Is <p> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
  10. 10.🖼️ Which picture file does the browser load?
    <img src="map.png" alt="Map of India" width="400">
    (a) dog.jpg (b) map.png (c) Map of India (d) cake.jpg
  11. 11.Which of these is an empty tag? (a) <h1> (b) <br> (c) <title> (d) <li>
  12. 12.🔠 Which heading shows the BIGGEST text: <h6>, <h2>, <h1> or <h3>? (a) <h2> (b) <h3> (c) <h6> (d) <h1>
  13. 13.🔍 One closing tag is missing. Which one?
    <i>Cricket is fun.
    <p>I love mangoes.</p>
    <h1>Rain today</h1>
    (a) </small> (b) </p> (c) </h1> (d) </i>
  14. 14.🔍 Which line is missing its closing tag?
    line 1: <strong>Cricket is fun.
    line 2: <small>Our school trip</small>
    line 3: <h2>Rain today</h2>
    (a) line 2 (b) line 3 (c) line 1
  15. 15.💬 Which text will NOT show on the page?
    <p>My best friend</p>
    <!-- <p>My pets</p> -->
    <p>Good morning!</p>
    <p>I love mangoes.</p>
    (a) My best friend (b) Good morning! (c) I love mangoes. (d) My pets
  16. 16.🔗 Where does this link open?
    <a href="games.html">Take the quiz</a>
    (a) in a new tab (b) in the same tab
  17. 17.💬 Does the browser show comments on the page? (a) Yes (b) No
  18. 18.📝 You type 5 spaces between two words in a <p>. How does the browser show them? (a) as 5 spaces (b) as a dot (c) as one space (d) as a new line
  19. 19.📄 Which part holds everything you see on the page? (a) the title (b) the body (c) the doctype (d) the head
  20. 20.📝 How many paragraphs does this code make?
    <p>Good morning!</p>
    <p>My best friend</p>
    <p>Fun facts</p>
    <h2>Rain today</h2>
  21. 21.🔠 Which heading shows the SMALLEST text: <h2>, <h3>, <h5> or <h1>? (a) <h2> (b) <h5> (c) <h1> (d) <h3>
  22. 22.📄 Where does <meta charset="utf-8"> go: in the head or in the body? (a) in the body (b) in the head
  23. 23.💬 How many paragraphs show on the page?
    <!-- <p>Fun facts</p> -->
    <!-- <p>My pets</p> -->
    <p>Good morning!</p>
    <!-- <p>My best friend</p> -->
    <!-- <p>I love mangoes.</p> -->
  24. 24.🔗 What does target="_blank" do to a link? (a) hides the link (b) makes it bold (c) makes it blank (d) opens it in a new tab
  25. 25.🏷️ HTML marks up text using ___. (a) wires (b) tags (c) keys (d) pixels
  26. 26.📝 On how many lines does the browser show this paragraph?
    <p>Stars shine<br>Kites fly high</p>
  27. 27.📄 What does the browser tab show for this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Class 7 Blog</title>
    </head>
    <body>
      <h1>All about me</h1>
      <p>Mars is red.</p>
    </body>
    </html>
    (a) Mars is red. (b) index.html (c) Class 7 Blog (d) All about me
  28. 28.🔠 Which heading shows the SMALLEST text: <h2>, <h6>, <h5> or <h1>? (a) <h5> (b) <h6> (c) <h1> (d) <h2>
  29. 29.🔠 Which heading shows the BIGGEST text: <h4>, <h2>, <h3> or <h5>? (a) <h2> (b) <h5> (c) <h4> (d) <h3>
  30. 30.🖼️ Why do we add alt text to an image? (a) to load it faster (b) to make it bigger (c) to colour it (d) to describe the image
  31. 31.💬 Which text will NOT show on the page?
    <p>The red kite</p>
    <p>Cricket is fun.</p>
    <!-- <p>My best friend</p> -->
    (a) My best friend (b) Cricket is fun. (c) The red kite
  32. 32.💬 How many paragraphs show on the page?
    <!-- <p>The red kite</p> -->
    <p>My best friend</p>
    <p>Hello, world!</p>
    <p>Rain today</p>
  33. 33.💬 Which text will NOT show on the page?
    <p>Good morning!</p>
    <!-- <p>Fun facts</p> -->
    <p>My best friend</p>
    (a) Good morning! (b) My best friend (c) Fun facts
  34. 34.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="fort.jpg" alt="An old fort" width="150">
    (a) fort.jpg (b) A tiger asleep (c) An old fort (d) width
  35. 35.🔗 Where does this link open?
    <a href="about.html">About us</a>
    (a) in a new tab (b) in the same tab
  36. 36.🌐 Which one colours code to help us? (a) a web server (b) a code editor (c) a web browser
  37. 37.True or false: <ol> shows bullet points. (a) False (b) True
  38. 38.🖼️ Which attribute of <img> is read by screen readers? (a) src (b) alt (c) height (d) width
  39. 39.📄 Where does the text of <title> appear? (a) at the bottom (b) nowhere (c) in a big heading (d) on the browser tab
  40. 40.Which of these is a closing tag? (a) </h1> (b) <li> (c) <b> (d) <p>

Answer key

  1. False
  2. src
  3. Class 7 Blog
  4. <h1>
  5. <h1>
  6. 6
  7. <h1>
  8. False
  9. an opening tag
  10. map.png
  11. <br>
  12. <h1>
  13. </i>
  14. line 1
  15. My pets
  16. in the same tab
  17. No
  18. as one space
  19. the body
  20. 3
  21. <h5>
  22. in the head
  23. 1
  24. opens it in a new tab
  25. tags
  26. 2
  27. Class 7 Blog
  28. <h6>
  29. <h2>
  30. to describe the image
  31. My best friend
  32. 3
  33. Fun facts
  34. An old fort
  35. in the same tab
  36. a code editor
  37. False
  38. alt
  39. on the browser tab
  40. </h1>

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