← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 787 · 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 words do you click on?
    <a href="maths.html">About us</a>
    (a) Contact us (b) maths.html (c) href (d) About us
  2. 2.🌐 Which one is where we type code? (a) a code editor (b) a web server (c) a web browser
  3. 3.🏷️ Is </p> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
  4. 4.🔗 Which words do you click on?
    <a href="art.html">Play games</a>
    (a) href (b) art.html (c) About us (d) Play games
  5. 5.Which of these is true of a code editor? (a) shows line numbers (b) opens web pages for us (c) shows pages from the web (d) turns HTML into a page
  6. 6.🔠 How many heading levels does HTML have? (a) 4 (b) 3 (c) 10 (d) 6
  7. 7.📋 Which list tag shows 1, 2, 3 numbers? (a) <ul> (b) <ol> (c) <li>
  8. 8.🔠 How many <h1> headings should a page usually have? (a) 3 (b) 6 (c) 1 (d) 10
  9. 9.True or false: a web server is where we type code. (a) True (b) False
  10. 10.📝 How many paragraphs does this code make?
    <p>My best friend</p>
    <p>My pets</p>
    <p>Cricket is fun.</p>
    <h2>My pets</h2>
  11. 11.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="kite.png" alt="A red kite" width="50">
    (a) Map of India (b) kite.png (c) width (d) A red kite
  12. 12.📄 What does the browser tab show for this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>My Hobbies</title>
    </head>
    <body>
      <h1>Planets</h1>
      <p>Try this poha.</p>
    </body>
    </html>
    (a) Try this poha. (b) Planets (c) My Hobbies (d) index.html
  13. 13.📋 How many items does this list show?
    <ol>
      <li>Mango</li>
      <li>Guava</li>
      <li>Jamun</li>
    </ol>
  14. 14.🔠 Which heading shows the SMALLEST text: <h4>, <h3>, <h5> or <h2>? (a) <h4> (b) <h5> (c) <h3> (d) <h2>
  15. 15.True or false: <p> is an empty tag. (a) False (b) True
  16. 16.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="fort.jpg" alt="An old fort" width="100">
    (a) An old fort (b) fort.jpg (c) A tiger asleep (d) width
  17. 17.🖼️ Which attribute of <img> shows if the image fails? (a) src (b) alt (c) width (d) height
  18. 18.📝 How many paragraphs does this code make?
    <p>I love mangoes.</p>
    <p>Good morning!</p>
    <h2>Cricket is fun.</h2>
  19. 19.📄 Where does <table> go: in the head or in the body? (a) in the head (b) in the body
  20. 20.🖼️ Which tag puts a picture on a page? (a) <img> (b) <a> (c) <pic> (d) <p>
  21. 21.Which of these has a closing tag? (a) <meta> (b) <hr> (c) <img> (d) <ul>
  22. 22.📝 Does <br> have a closing tag, or is it an empty tag? (a) has a closing tag (b) an empty tag
  23. 23.🔗 Where does this link open?
    <a href="contact.html">Maths fun</a>
    (a) in a new tab (b) in the same tab
  24. 24.📄 Where does the text of <title> appear? (a) at the bottom (b) nowhere (c) on the browser tab (d) in a big heading
  25. 25.True or false: HTML on its own can run a game loop. (a) False (b) True
  26. 26.📋 How many items does this list show?
    <ol>
      <li>Grapes</li>
      <li>Banana</li>
      <li>Litchi</li>
      <li>Mango</li>
    </ol>
  27. 27.🖼️ Which attribute of <img> names the picture file? (a) height (b) width (c) alt (d) src
  28. 28.🖼️ Which attribute of <img> sets how tall it is? (a) height (b) width (c) alt (d) src
  29. 29.🔗 What does target="_blank" do to a link? (a) hides the link (b) makes it blank (c) opens it in a new tab (d) makes it bold
  30. 30.🔠 How many headings are in this code?
    <h1>Rain today</h1>
    <p>I love mangoes.</p>
    <h4>Rain today</h4>
  31. 31.Which of these is true of a code editor? (a) turns HTML into a page (b) colours code to help us (c) hosts websites online (d) sends pages over the net
  32. 32.🔢 In a basic web page file, which comes first: “<html>” or “<!DOCTYPE html>”? (a) <html> (b) <!DOCTYPE html>
  33. 33.📄 Where does <img> go: in the head or in the body? (a) in the body (b) in the head
  34. 34.🖼️ Does <img> need a closing tag? (a) No (b) Yes
  35. 35.🖼️ Why do we add alt text to an image? (a) to load it faster (b) to make it bigger (c) to describe the image (d) to colour it
  36. 36.📄 What does the browser tab show for this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Art Gallery</title>
    </head>
    <body>
      <h1>Planets</h1>
      <p>Thanks for visiting.</p>
    </body>
    </html>
    (a) index.html (b) Art Gallery (c) Planets (d) Thanks for visiting.
  37. 37.📄 Where does <title> go: in the head or in the body? (a) in the body (b) in the head
  38. 38.🔗 Which words do you click on?
    <a href="quiz.html">Maths fun</a>
    (a) href (b) Art corner (c) Maths fun (d) quiz.html
  39. 39.Which of these goes in the body? (a) <link rel="stylesheet"> (b) <meta charset="utf-8"> (c) <style> (d) <a>
  40. 40.📛 In <a href="x.html">, what is href? (a) a comment (b) a closing tag (c) an element name (d) an attribute

Answer key

  1. About us
  2. a code editor
  3. a closing tag
  4. Play games
  5. shows line numbers
  6. 6
  7. <ol>
  8. 1
  9. False
  10. 3
  11. A red kite
  12. My Hobbies
  13. 3
  14. <h5>
  15. False
  16. An old fort
  17. alt
  18. 2
  19. in the body
  20. <img>
  21. <ul>
  22. an empty tag
  23. in the same tab
  24. on the browser tab
  25. False
  26. 4
  27. src
  28. height
  29. opens it in a new tab
  30. 2
  31. colours code to help us
  32. <!DOCTYPE html>
  33. in the body
  34. No
  35. to describe the image
  36. Art Gallery
  37. in the head
  38. Maths fun
  39. <a>
  40. an attribute

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