← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 415 · 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 tag is the least important heading? (a) <h6> (b) <h3> (c) <h1> (d) <p>
  2. 2.💬 How many paragraphs show on the page?
    <p>My pets</p>
    <!-- <p>Good morning!</p> -->
    <p>My best friend</p>
    <p>Cricket is fun.</p>
    <p>Hello, world!</p>
  3. 3.💬 Which text will NOT show on the page?
    <p>My best friend</p>
    <p>Cricket is fun.</p>
    <p>Our school trip</p>
    <!-- <p>Hello, world!</p> -->
    (a) Our school trip (b) My best friend (c) Cricket is fun. (d) Hello, world!
  4. 4.🔗 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
  5. 5.📄 Where does <img> go: in the head or in the body? (a) in the body (b) in the head
  6. 6.📄 What does the browser tab show for this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Art Gallery</title>
    </head>
    <body>
      <h1>Planets</h1>
      <p>Mars is red.</p>
    </body>
    </html>
    (a) Art Gallery (b) Mars is red. (c) index.html (d) Planets
  7. 7.🖼️ Why do we add alt text to an image? (a) to colour it (b) to describe the image (c) to make it bigger (d) to load it faster
  8. 8.🔍 Which line is missing its closing tag?
    line 1: <h2>Cricket is fun.</h2>
    line 2: <h1>My best friend</h1>
    line 3: <em>I love mangoes.
    (a) line 3 (b) line 2 (c) line 1
  9. 9.🔍 Which line is missing its closing tag?
    line 1: <i>Our school trip</i>
    line 2: <strong>Cricket is fun.</strong>
    line 3: <em>Rain today
    (a) line 2 (b) line 3 (c) line 1
  10. 10.💬 Which text will NOT show on the page?
    <p>Fun facts</p>
    <!-- <p>My pets</p> -->
    <p>The red kite</p>
    (a) My pets (b) Fun facts (c) The red kite
  11. 11.True or false: <p> is an empty tag. (a) False (b) True
  12. 12.📋 What number does the browser show next to “Jamun”?
    <ol>
      <li>Mango</li>
      <li>Jamun</li>
      <li>Papaya</li>
      <li>Grapes</li>
    </ol>
  13. 13.📋 Does this list show bullets or numbers?
    <ul>
      <li>Jamun</li>
      <li>Banana</li>
    </ul>
    (a) bullets (b) numbers
  14. 14.💬 Does the browser show comments on the page? (a) No (b) Yes
  15. 15.🔢 In a basic web page file, which comes FIRST? (a) <!DOCTYPE html> (b) </head> (c) <head> (d) </body>
  16. 16.🔠 How many headings are in this code?
    <h1>Cricket is fun.</h1>
    <h3>Hello, world!</h3>
    <h3>Cricket is fun.</h3>
  17. 17.📋 What number does the browser show next to “Mango”?
    <ol start="6">
      <li>Jamun</li>
      <li>Grapes</li>
      <li>Mango</li>
      <li>Orange</li>
      <li>Papaya</li>
      <li>Guava</li>
    </ol>
  18. 18.🏷️ What does a closing tag have that an opening tag does not? (a) a slash / (b) a dollar $ (c) a dot . (d) a hash #
  19. 19.🔗 Which words do you click on?
    <a href="games.html">Take the quiz</a>
    (a) Play games (b) Take the quiz (c) href (d) games.html
  20. 20.📄 Which part holds everything you see on the page? (a) the body (b) the head (c) the doctype (d) the title
  21. 21.True or false: <title> goes in the head. (a) False (b) True
  22. 22.💬 How does an HTML comment start? (a) # (b) // (c) /* (d) <!--
  23. 23.🔠 Which heading shows the SMALLEST text: <h4>, <h3>, <h1> or <h5>? (a) <h4> (b) <h3> (c) <h1> (d) <h5>
  24. 24.📄 Where does <link rel="stylesheet"> go: in the head or in the body? (a) in the head (b) in the body
  25. 25.🖼️ Which picture file does the browser load?
    <img src="bus.jpg" alt="Our school bus" width="300">
    (a) Our school bus (b) tiger.jpg (c) fort.jpg (d) bus.jpg
  26. 26.📋 How many items does this list show?
    <ul>
      <li>Litchi</li>
      <li>Papaya</li>
    </ul>
  27. 27.🔗 Where does this link open?
    <a href="contact.html">Visit the site</a>
    (a) in the same tab (b) in a new tab
  28. 28.📄 What is the big heading shown on this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Art Gallery</title>
    </head>
    <body>
      <h1>Easy snacks</h1>
      <p>Thanks for visiting.</p>
    </body>
    </html>
    (a) Art Gallery (b) Easy snacks (c) body (d) Thanks for visiting.
  29. 29.🔠 Which heading shows the BIGGEST text: <h2>, <h1>, <h6> or <h5>? (a) <h6> (b) <h2> (c) <h5> (d) <h1>
  30. 30.True or false: in <img>, width sets how tall it is. (a) True (b) False
  31. 31.🏷️ Is </title> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
  32. 32.📄 What does the browser tab show for this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Riya’s Recipes</title>
    </head>
    <body>
      <h1>Welcome!</h1>
      <p>I like to read.</p>
    </body>
    </html>
    (a) index.html (b) Riya’s Recipes (c) Welcome! (d) I like to read.
  33. 33.Which of these has a closing tag? (a) <hr> (b) <img> (c) <input> (d) <b>
  34. 34.🖼️ Which picture file does the browser load?
    <img src="fort.jpg" alt="An old fort" width="400">
    (a) kite.png (b) An old fort (c) tiger.jpg (d) fort.jpg
  35. 35.🔠 Which heading shows the BIGGEST text: <h4>, <h1>, <h2> or <h5>? (a) <h5> (b) <h4> (c) <h1> (d) <h2>
  36. 36.📄 What is the first line of an HTML5 page? (a) <body> (b) <head> (c) <html> (d) <!DOCTYPE html>
  37. 37.📛 In <a href="x.html">, what is href? (a) an attribute (b) a closing tag (c) an element name (d) a comment
  38. 38.💬 How many paragraphs show on the page?
    <!-- <p>Good morning!</p> -->
    <!-- <p>Rain today</p> -->
    <!-- <p>Fun facts</p> -->
    <p>Cricket is fun.</p>
  39. 39.🔠 How many headings are in this code?
    <h1>Fun facts</h1>
    <p>Rain today</p>
    <h2>Fun facts</h2>
    <h2>Good morning!</h2>
  40. 40.📝 On how many lines does the browser show this paragraph?
    <p>Rivers flow<br>Sky is blue</p>

Answer key

  1. <h6>
  2. 4
  3. Hello, world!
  4. opens it in a new tab
  5. in the body
  6. Art Gallery
  7. to describe the image
  8. line 3
  9. line 3
  10. My pets
  11. False
  12. 2
  13. bullets
  14. No
  15. <!DOCTYPE html>
  16. 3
  17. 8
  18. a slash /
  19. Take the quiz
  20. the body
  21. True
  22. <!--
  23. <h5>
  24. in the head
  25. bus.jpg
  26. 2
  27. in the same tab
  28. Easy snacks
  29. <h1>
  30. False
  31. a closing tag
  32. Riya’s Recipes
  33. <b>
  34. fort.jpg
  35. <h1>
  36. <!DOCTYPE html>
  37. an attribute
  38. 1
  39. 3
  40. 2

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