← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 458 · 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 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
  2. 2.Which of these is true of a code editor? (a) shows pages from the web (b) sends pages over the net (c) hosts websites online (d) is where we type code
  3. 3.🔠 How many headings are in this code?
    <h1>Hello, world!</h1>
    <h3>I love mangoes.</h3>
    <p>Our school trip</p>
    <h3>My pets</h3>
    <h4>Hello, world!</h4>
  4. 4.🖼️ Which attribute of <img> describes the picture? (a) src (b) height (c) width (d) alt
  5. 5.📄 What is the first line of an HTML5 page? (a) <!DOCTYPE html> (b) <head> (c) <html> (d) <body>
  6. 6.📝 On how many lines does the browser show this paragraph?
    <p>Stars shine<br>Roses are red<br>Kites fly high<br>Birds sing</p>
  7. 7.💬 Which text will NOT show on the page?
    <!-- <p>The red kite</p> -->
    <p>My best friend</p>
    <p>I love mangoes.</p>
    (a) The red kite (b) I love mangoes. (c) My best friend
  8. 8.📄 Where does <ul> go: in the head or in the body? (a) in the body (b) in the head
  9. 9.Which of these is a closing tag? (a) </b> (b) <title> (c) <li> (d) <b>
  10. 10.🔍 Which line is missing its closing tag?
    line 1: <i>I love mangoes.</i>
    line 2: <u>Our school trip</u>
    line 3: <strong>Hello, world!
    (a) line 2 (b) line 3 (c) line 1
  11. 11.📋 How many items does this list show?
    <ol>
      <li>Banana</li>
      <li>Papaya</li>
    </ol>
  12. 12.True or false: <a> goes in the body. (a) False (b) True
  13. 13.🔗 Which address opens when you click this link?
    <a href="about.html">About us</a>
    (a) https://example.com (b) contact.html (c) About us (d) about.html
  14. 14.🏷️ Is <h1> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
  15. 15.🔗 Which words do you click on?
    <a href="contact.html">Contact us</a>
    (a) Visit the site (b) Contact us (c) href (d) contact.html
  16. 16.Which of these is true of a web browser? (a) shows line numbers (b) shows pages from the web (c) is where we type code (d) sends pages over the net
  17. 17.🔠 Which heading shows the BIGGEST text: <h5>, <h6>, <h3> or <h4>? (a) <h3> (b) <h6> (c) <h5> (d) <h4>
  18. 18.💬 How many paragraphs show on the page?
    <p>The red kite</p>
    <p>Rain today</p>
    <!-- <p>Hello, world!</p> -->
    <p>Cricket is fun.</p>
  19. 19.🔍 Which is the odd one out? (a) hosts websites online (b) answers page requests (c) sends pages over the net (d) opens web pages for us
  20. 20.🖼️ Which picture file does the browser load?
    <img src="tiger.jpg" alt="A tiger asleep" width="400">
    (a) kite.png (b) A tiger asleep (c) tiger.jpg (d) map.png
  21. 21.🏷️ Is </title> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
  22. 22.📄 What is the big heading shown on this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Space Facts</title>
    </head>
    <body>
      <h1>Welcome!</h1>
      <p>We won by 5 runs.</p>
    </body>
    </html>
    (a) We won by 5 runs. (b) Space Facts (c) body (d) Welcome!
  23. 23.Which of these goes in the head? (a) <h1> (b) <ul> (c) <img> (d) <meta charset="utf-8">
  24. 24.🔗 Where does this link open?
    <a href="quiz.html" target="_blank">Visit the site</a>
    (a) in a new tab (b) in the same tab
  25. 25.📝 What does <hr> draw? (a) a table (b) a link (c) a picture (d) a line across the page
  26. 26.🔍 Which is the odd one out? (a) opens web pages for us (b) has an address bar (c) turns HTML into a page (d) stores a website’s files
  27. 27.💬 How many paragraphs show on the page?
    <p>Cricket is fun.</p>
    <!-- <p>Our school trip</p> -->
    <!-- <p>I love mangoes.</p> -->
  28. 28.Which of these is a closing tag? (a) <h1> (b) <p> (c) <li> (d) </title>
  29. 29.📄 What is the big heading shown on this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Riya’s Recipes</title>
    </head>
    <body>
      <h1>Easy snacks</h1>
      <p>I like to read.</p>
    </body>
    </html>
    (a) Riya’s Recipes (b) Easy snacks (c) I like to read. (d) body
  30. 30.True or false: <a> goes in the head. (a) False (b) True
  31. 31.📋 Which list tag shows bullet points? (a) <ol> (b) <ul> (c) <li>
  32. 32.📋 Does this list show bullets or numbers?
    <ol>
      <li>Papaya</li>
      <li>Jamun</li>
      <li>Banana</li>
    </ol>
    (a) bullets (b) numbers
  33. 33.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="bus.jpg" alt="Our school bus" width="150">
    (a) bus.jpg (b) width (c) Our school bus (d) An old fort
  34. 34.🖼️ Which picture file does the browser load?
    <img src="cake.jpg" alt="Birthday cake" width="250">
    (a) moon.png (b) cake.jpg (c) dog.jpg (d) Birthday cake
  35. 35.📋 Which list tag shows 1, 2, 3 numbers? (a) <ol> (b) <ul> (c) <li>
  36. 36.📋 Which tag goes around each item of a list? (a) <ol> (b) <ul> (c) <p> (d) <li>
  37. 37.📝 What does <br> do? (a) starts a new line (b) makes text bold (c) makes a list (d) adds a picture
  38. 38.📋 Which list shows the steps of a recipe best? (a) <br> (b) <ol> (c) <hr> (d) <ul>
  39. 39.🔠 How many <h1> headings should a page usually have? (a) 3 (b) 6 (c) 10 (d) 1
  40. 40.💬 How does an HTML comment start? (a) /* (b) <!-- (c) // (d) #

Answer key

  1. opens it in a new tab
  2. is where we type code
  3. 4
  4. alt
  5. <!DOCTYPE html>
  6. 4
  7. The red kite
  8. in the body
  9. </b>
  10. line 3
  11. 2
  12. True
  13. about.html
  14. an opening tag
  15. Contact us
  16. shows pages from the web
  17. <h3>
  18. 3
  19. opens web pages for us
  20. tiger.jpg
  21. a closing tag
  22. Welcome!
  23. <meta charset="utf-8">
  24. in a new tab
  25. a line across the page
  26. stores a website’s files
  27. 1
  28. </title>
  29. Easy snacks
  30. False
  31. <ul>
  32. numbers
  33. Our school bus
  34. cake.jpg
  35. <ol>
  36. <li>
  37. starts a new line
  38. <ol>
  39. 1
  40. <!--

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