← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 400 · 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.📝 What does <hr> draw? (a) a picture (b) a line across the page (c) a table (d) a link
  2. 2.📄 Where does the text of <title> appear? (a) nowhere (b) on the browser tab (c) at the bottom (d) in a big heading
  3. 3.📝 Does <img> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
  4. 4.🔍 Which line is missing its closing tag?
    line 1: <small>Fun facts</small>
    line 2: <u>I love mangoes.</u>
    line 3: <p>The red kite
    (a) line 3 (b) line 2 (c) line 1
  5. 5.🔗 Which address opens when you click this link?
    <a href="quiz.html">Art corner</a>
    (a) Art corner (b) games.html (c) quiz.html (d) about.html
  6. 6.🖼️ Which picture file does the browser load?
    <img src="map.png" alt="Map of India" width="150">
    (a) dog.jpg (b) map.png (c) cake.jpg (d) Map of India
  7. 7.🧩 An opening tag + content + a closing tag together make an ___. (a) editor (b) address (c) attribute (d) element
  8. 8.True or false: <ul> goes inside ul or ol. (a) False (b) True
  9. 9.📄 Where does <meta charset="utf-8"> go: in the head or in the body? (a) in the body (b) in the head
  10. 10.🖼️ How many pixels wide is the picture drawn?
    <img src="kite.png" alt="A red kite" width="50">
  11. 11.Which of these goes in the body? (a) <style> (b) <link rel="stylesheet"> (c) <title> (d) <img>
  12. 12.🔗 Which attribute holds the address of a link? (a) alt (b) id (c) src (d) href
  13. 13.🔗 Which words do you click on?
    <a href="quiz.html">Maths fun</a>
    (a) href (b) quiz.html (c) Maths fun (d) Art corner
  14. 14.🖼️ Why do we add alt text to an image? (a) to load it faster (b) to describe the image (c) to make it bigger (d) to colour it
  15. 15.🔡 Are HTML tag names usually written in small letters? (a) No (b) Yes
  16. 16.📋 How many items does this list show?
    <ol>
      <li>Orange</li>
      <li>Papaya</li>
      <li>Grapes</li>
      <li>Jamun</li>
      <li>Banana</li>
      <li>Guava</li>
    </ol>
  17. 17.🏷️ Which is the closing tag for <u>? (a) <u> (b) </u> (c) <\u> (d) <u/>
  18. 18.💬 How many paragraphs show on the page?
    <!-- <p>Cricket is fun.</p> -->
    <!-- <p>Good morning!</p> -->
    <p>Fun facts</p>
  19. 19.📄 What does the browser tab show for this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Space Facts</title>
    </head>
    <body>
      <h1>Easy snacks</h1>
      <p>Try this poha.</p>
    </body>
    </html>
    (a) Space Facts (b) Easy snacks (c) Try this poha. (d) index.html
  20. 20.True or false: <ol> is one item of a list. (a) False (b) True
  21. 21.💬 How many paragraphs show on the page?
    <p>My pets</p>
    <!-- <p>Our school trip</p> -->
    <p>Cricket is fun.</p>
    <!-- <p>Rain today</p> -->
  22. 22.🏷️ Is <body> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
  23. 23.📄 What is the big heading shown on this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Space Facts</title>
    </head>
    <body>
      <h1>All about me</h1>
      <p>Thanks for visiting.</p>
    </body>
    </html>
    (a) body (b) All about me (c) Space Facts (d) Thanks for visiting.
  24. 24.Which of these is a closing tag? (a) <p> (b) </title> (c) <body> (d) <b>
  25. 25.🔗 Which address opens when you click this link?
    <a href="maths.html">About us</a>
    (a) news.html (b) art.html (c) maths.html (d) About us
  26. 26.🔠 Which heading shows the SMALLEST text: <h1>, <h4>, <h2> or <h3>? (a) <h3> (b) <h4> (c) <h1> (d) <h2>
  27. 27.🔍 Which line is missing its closing tag?
    line 1: <p>The red kite</p>
    line 2: <i>Rain today</i>
    line 3: <b>My pets
    (a) line 3 (b) line 2 (c) line 1
  28. 28.💬 How many paragraphs show on the page?
    <p>Rain today</p>
    <!-- <p>Our school trip</p> -->
    <!-- <p>The red kite</p> -->
    <!-- <p>Hello, world!</p> -->
  29. 29.🔍 One closing tag is missing. Which one?
    <strong>Our school trip
    <u>Rain today</u>
    <i>Good morning!</i>
    (a) </i> (b) </strong> (c) </u> (d) </h1>
  30. 30.🔠 How many headings are in this code?
    <h1>Our school trip</h1>
    <h2>My pets</h2>
    <h2>Good morning!</h2>
    <h2>Cricket is fun.</h2>
  31. 31.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="tiger.jpg" alt="A tiger asleep" width="250">
    (a) A tiger asleep (b) width (c) tiger.jpg (d) A red kite
  32. 32.🔗 Which code links to about.html? (a) <link about.html> (b) <a href="about.html"> (c) <a src="about.html"> (d) <a alt="about.html">
  33. 33.Which of these is an opening tag? (a) </b> (b) <h1> (c) </li> (d) </p>
  34. 34.📝 On how many lines does the browser show this paragraph?
    <p>Rivers flow<br>Kites fly high<br>Stars shine</p>
  35. 35.🔗 Where does this link open?
    <a href="about.html">Take the quiz</a>
    (a) in a new tab (b) in the same tab
  36. 36.🔗 Which words do you click on?
    <a href="games.html">Visit the site</a>
    (a) Maths fun (b) href (c) Visit the site (d) games.html
  37. 37.Which of these goes in the body? (a) <table> (b) <style> (c) <title> (d) <link rel="stylesheet">
  38. 38.💬 Which text will NOT show on the page?
    <p>I love mangoes.</p>
    <p>Fun facts</p>
    <p>My best friend</p>
    <!-- <p>My pets</p> -->
    (a) My pets (b) Fun facts (c) My best friend (d) I love mangoes.
  39. 39.📝 What does <p> make? (a) a picture (b) a table (c) a link (d) a paragraph
  40. 40.📝 What do we need to write HTML? (a) a plain text editor (b) a paintbrush (c) a microphone (d) a printer

Answer key

  1. a line across the page
  2. on the browser tab
  3. an empty tag
  4. line 3
  5. quiz.html
  6. map.png
  7. element
  8. False
  9. in the head
  10. 50
  11. <img>
  12. href
  13. Maths fun
  14. to describe the image
  15. Yes
  16. 6
  17. </u>
  18. 1
  19. Space Facts
  20. False
  21. 2
  22. an opening tag
  23. All about me
  24. </title>
  25. maths.html
  26. <h4>
  27. line 3
  28. 1
  29. </strong>
  30. 4
  31. A tiger asleep
  32. <a href="about.html">
  33. <h1>
  34. 3
  35. in the same tab
  36. Visit the site
  37. <table>
  38. My pets
  39. a paragraph
  40. a plain text editor

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