← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 904 · 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 attribute of <img> tells which image to load? (a) src (b) alt (c) width (d) height
  2. 2.Which of these is an opening tag? (a) </p> (b) </body> (c) </h1> (d) <b>
  3. 3.💬 How many paragraphs show on the page?
    <!-- <p>I love mangoes.</p> -->
    <p>Cricket is fun.</p>
    <!-- <p>Good morning!</p> -->
  4. 4.🔗 Which words do you click on?
    <a href="games.html">Visit the site</a>
    (a) games.html (b) Visit the site (c) Maths fun (d) href
  5. 5.🖼️ Which attribute of <img> is read by screen readers? (a) src (b) alt (c) width (d) height
  6. 6.🔗 Which words do you click on?
    <a href="about.html">Art corner</a>
    (a) about.html (b) School news (c) href (d) Art corner
  7. 7.Which of these is true of a web server? (a) colours code to help us (b) shows pages from the web (c) is where we type code (d) stores a website’s files
  8. 8.🔍 One closing tag is missing. Which one?
    <em>My pets</em>
    <small>Good morning!
    <h2>The red kite</h2>
    (a) </small> (b) </h3> (c) </em> (d) </h2>
  9. 9.💬 How does an HTML comment start? (a) /* (b) # (c) <!-- (d) //
  10. 10.🔗 What does target="_blank" do to a link? (a) opens it in a new tab (b) hides the link (c) makes it bold (d) makes it blank
  11. 11.📝 How many paragraphs does this code make?
    <p>Fun facts</p>
    <h2>Fun facts</h2>
    <p>My best friend</p>
    <h2>The red kite</h2>
    <p>Good morning!</p>
  12. 12.💬 Does the browser show comments on the page? (a) Yes (b) No
  13. 13.🖼️ Which picture file does the browser load?
    <img src="dog.jpg" alt="A happy dog" width="200">
    (a) bus.jpg (b) dog.jpg (c) A happy dog (d) moon.png
  14. 14.📋 How many items does this list show?
    <ul>
      <li>Papaya</li>
      <li>Orange</li>
      <li>Mango</li>
    </ul>
  15. 15.True or false: <b> has a closing tag. (a) False (b) True
  16. 16.📋 Which list tag shows bullet points? (a) <ul> (b) <ol> (c) <li>
  17. 17.True or false: a code editor turns HTML into a page. (a) False (b) True
  18. 18.🔗 Which tag makes a clickable link? (a) <link> (b) <a> (c) <p> (d) <img>
  19. 19.📝 How many paragraphs does this code make?
    <p>My pets</p>
    <h2>Our school trip</h2>
    <h2>My pets</h2>
    <p>My pets</p>
    <p>My best friend</p>
    <h2>My best friend</h2>
  20. 20.🖼️ Which attribute of <img> sets how wide it is? (a) height (b) width (c) alt (d) src
  21. 21.🔗 Where does this link open?
    <a href="contact.html" target="_blank">About us</a>
    (a) in a new tab (b) in the same tab
  22. 22.🖼️ Which picture file does the browser load?
    <img src="kite.png" alt="A red kite" width="150">
    (a) kite.png (b) map.png (c) A red kite (d) cake.jpg
  23. 23.🌐 Which one is where we type code? (a) a code editor (b) a web server (c) a web browser
  24. 24.📋 How many items does this list show?
    <ul>
      <li>Guava</li>
      <li>Banana</li>
      <li>Jamun</li>
      <li>Mango</li>
    </ul>
  25. 25.📄 What is the big heading shown on this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Art Gallery</title>
    </head>
    <body>
      <h1>Planets</h1>
      <p>Mars is red.</p>
    </body>
    </html>
    (a) body (b) Art Gallery (c) Planets (d) Mars is red.
  26. 26.🔠 Which heading shows the BIGGEST text: <h3>, <h5>, <h4> or <h6>? (a) <h4> (b) <h5> (c) <h6> (d) <h3>
  27. 27.🔠 How many headings are in this code?
    <h1>My best friend</h1>
    <p>My best friend</p>
    <h3>I love mangoes.</h3>
  28. 28.🖼️ Which tag puts a picture on a page? (a) <p> (b) <img> (c) <a> (d) <pic>
  29. 29.Which of these is an empty tag? (a) <p> (b) <img> (c) <h1> (d) <ul>
  30. 30.🔠 Which heading shows the SMALLEST text: <h3>, <h4>, <h6> or <h1>? (a) <h1> (b) <h3> (c) <h4> (d) <h6>
  31. 31.🔠 How many headings are in this code?
    <h1>My pets</h1>
    <p>Good morning!</p>
    <p>Good morning!</p>
  32. 32.True or false: HTML on its own cannot add up two numbers. (a) False (b) True
  33. 33.🏷️ Is </h1> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
  34. 34.📝 How many paragraphs does this code make?
    <p>Our school trip</p>
    <h2>I love mangoes.</h2>
    <h2>I love mangoes.</h2>
    <p>My pets</p>
  35. 35.True or false: in <img>, alt shows if the image fails. (a) False (b) True
  36. 36.💬 How many paragraphs show on the page?
    <!-- <p>I love mangoes.</p> -->
    <p>My pets</p>
    <p>Good morning!</p>
  37. 37.🔗 Which words do you click on?
    <a href="quiz.html">School news</a>
    (a) School news (b) quiz.html (c) href (d) Take the quiz
  38. 38.True or false: HTML on its own cannot run a game loop. (a) True (b) False
  39. 39.🔍 One closing tag is missing. Which one?
    <strong>Our school trip</strong>
    <p>My pets
    <h3>Hello, world!</h3>
    (a) </strong> (b) </h3> (c) </i> (d) </p>
  40. 40.📝 On how many lines does the browser show this paragraph?
    <p>Roses are red<br>Birds sing<br>Rivers flow</p>

Answer key

  1. src
  2. <b>
  3. 1
  4. Visit the site
  5. alt
  6. Art corner
  7. stores a website’s files
  8. </small>
  9. <!--
  10. opens it in a new tab
  11. 3
  12. No
  13. dog.jpg
  14. 3
  15. True
  16. <ul>
  17. False
  18. <a>
  19. 3
  20. width
  21. in a new tab
  22. kite.png
  23. a code editor
  24. 4
  25. Planets
  26. <h3>
  27. 2
  28. <img>
  29. <img>
  30. <h6>
  31. 1
  32. True
  33. a closing tag
  34. 2
  35. True
  36. 2
  37. School news
  38. True
  39. </p>
  40. 3

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