← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 7 · 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 server colours code to help us. (a) True (b) False
  2. 2.🏷️ Which is the closing tag for <h2>? (a) <h2> (b) <\h2> (c) <h2/> (d) </h2>
  3. 3.🔗 Which words do you click on?
    <a href="contact.html">Contact us</a>
    (a) href (b) contact.html (c) Contact us (d) Visit the site
  4. 4.Which of these is an empty tag? (a) <b> (b) <p> (c) <ul> (d) <meta>
  5. 5.🏷️ Which is the closing tag for <em>? (a) <em> (b) <em/> (c) </em> (d) <\em>
  6. 6.🌐 Which one shows line numbers? (a) a web server (b) a web browser (c) a code editor
  7. 7.🔠 Which heading shows the BIGGEST text: <h3>, <h5>, <h4> or <h2>? (a) <h5> (b) <h2> (c) <h3> (d) <h4>
  8. 8.📛 In <a href="x.html">, what is href? (a) a closing tag (b) a comment (c) an attribute (d) an element name
  9. 9.📄 What does the browser tab show for this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>My Hobbies</title>
    </head>
    <body>
      <h1>Welcome!</h1>
      <p>I like to read.</p>
    </body>
    </html>
    (a) Welcome! (b) I like to read. (c) My Hobbies (d) index.html
  10. 10.💬 How many paragraphs show on the page?
    <p>Our school trip</p>
    <p>Cricket is fun.</p>
    <!-- <p>I love mangoes.</p> -->
    <!-- <p>Fun facts</p> -->
    <!-- <p>My best friend</p> -->
  11. 11.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="map.png" alt="Map of India" width="50">
    (a) Map of India (b) map.png (c) width (d) Birthday cake
  12. 12.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="bus.jpg" alt="Our school bus" width="350">
    (a) bus.jpg (b) An old fort (c) width (d) Our school bus
  13. 13.📝 How many paragraphs does this code make?
    <p>My pets</p>
    <h2>Our school trip</h2>
    <p>I love mangoes.</p>
  14. 14.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="map.png" alt="Map of India" width="200">
    (a) width (b) Birthday cake (c) map.png (d) Map of India
  15. 15.True or false: <ul> shows 1, 2, 3 numbers. (a) False (b) True
  16. 16.📝 How many paragraphs does this code make?
    <p>I love mangoes.</p>
    <p>My best friend</p>
    <h2>Cricket is fun.</h2>
    <p>The red kite</p>
    <p>My best friend</p>
    <p>I love mangoes.</p>
  17. 17.🔠 How many headings are in this code?
    <h1>Hello, world!</h1>
    <h4>Cricket is fun.</h4>
    <h4>Our school trip</h4>
  18. 18.💬 How many paragraphs show on the page?
    <!-- <p>Our school trip</p> -->
    <p>Hello, world!</p>
    <!-- <p>Good morning!</p> -->
    <p>Fun facts</p>
  19. 19.📋 Which list tag is an unordered list? (a) <li> (b) <ol> (c) <ul>
  20. 20.🔠 Are headings shown in bold by default? (a) No (b) Yes
  21. 21.📋 Which list tag shows bullet points? (a) <li> (b) <ul> (c) <ol>
  22. 22.True or false: a code editor opens web pages for us. (a) False (b) True
  23. 23.Which of these is an opening tag? (a) </h1> (b) </title> (c) <li> (d) </body>
  24. 24.🏷️ Which is the closing tag for <strong>? (a) <strong/> (b) </strong> (c) <strong> (d) <\strong>
  25. 25.💬 How does an HTML comment start? (a) # (b) /* (c) <!-- (d) //
  26. 26.💬 Does the browser show comments on the page? (a) Yes (b) No
  27. 27.🔍 Which line is missing its closing tag?
    line 1: <p>Our school trip</p>
    line 2: <em>The red kite
    line 3: <strong>Fun facts</strong>
    (a) line 1 (b) line 2 (c) line 3
  28. 28.📝 On how many lines does the browser show this paragraph?
    <p>Birds sing<br>Stars shine<br>Roses are red</p>
  29. 29.🖼️ Which picture file does the browser load?
    <img src="kite.png" alt="A red kite" width="400">
    (a) cake.jpg (b) A red kite (c) map.png (d) kite.png
  30. 30.🔠 Which heading shows the BIGGEST text: <h5>, <h1>, <h4> or <h2>? (a) <h5> (b) <h4> (c) <h1> (d) <h2>
  31. 31.📝 How many paragraphs does this code make?
    <p>I love mangoes.</p>
    <p>Good morning!</p>
    <h2>My pets</h2>
    <h2>Hello, world!</h2>
  32. 32.📄 Where does <meta charset="utf-8"> go: in the head or in the body? (a) in the head (b) in the body
  33. 33.🖼️ Which attribute of <img> shows if the image fails? (a) alt (b) width (c) height (d) src
  34. 34.💬 How many paragraphs show on the page?
    <!-- <p>Fun facts</p> -->
    <p>My best friend</p>
    <p>My pets</p>
    <p>Our school trip</p>
  35. 35.🔠 Which heading shows the SMALLEST text: <h2>, <h5>, <h1> or <h6>? (a) <h2> (b) <h1> (c) <h6> (d) <h5>
  36. 36.True or false: a web browser shows pages from the web. (a) False (b) True
  37. 37.💬 How many paragraphs show on the page?
    <!-- <p>I love mangoes.</p> -->
    <!-- <p>My pets</p> -->
    <p>Good morning!</p>
  38. 38.🏷️ Is <b> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
  39. 39.🖼️ How many pixels wide is the picture drawn?
    <img src="kite.png" alt="A red kite" width="300">
  40. 40.🔗 Which attribute holds the address of a link? (a) href (b) id (c) alt (d) src

Answer key

  1. False
  2. </h2>
  3. Contact us
  4. <meta>
  5. </em>
  6. a code editor
  7. <h2>
  8. an attribute
  9. My Hobbies
  10. 2
  11. Map of India
  12. Our school bus
  13. 2
  14. Map of India
  15. False
  16. 5
  17. 3
  18. 2
  19. <ul>
  20. Yes
  21. <ul>
  22. False
  23. <li>
  24. </strong>
  25. <!--
  26. No
  27. line 2
  28. 3
  29. kite.png
  30. <h1>
  31. 2
  32. in the head
  33. alt
  34. 3
  35. <h6>
  36. True
  37. 1
  38. an opening tag
  39. 300
  40. href

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