← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 642 · 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.🔍 One closing tag is missing. Which one?
    <i>My best friend
    <p>Cricket is fun.</p>
    <small>I love mangoes.</small>
    (a) </p> (b) </small> (c) </i> (d) </strong>
  2. 2.🔗 Which tag makes a clickable link? (a) <a> (b) <img> (c) <link> (d) <p>
  3. 3.🔗 Which attribute holds the address of a link? (a) src (b) alt (c) id (d) href
  4. 4.🔢 In a basic web page file, which comes first: “<head>” or “</body>”? (a) <head> (b) </body>
  5. 5.🔢 In a basic web page file, which comes LAST? (a) <body> (b) </head> (c) </html> (d) <!DOCTYPE html>
  6. 6.🔠 How many headings are in this code?
    <h1>My pets</h1>
    <p>Good morning!</p>
    <p>Good morning!</p>
    <p>My best friend</p>
  7. 7.True or false: in <img>, alt sets how wide it is. (a) True (b) False
  8. 8.🖼️ Which picture file does the browser load?
    <img src="moon.png" alt="The full moon" width="250">
    (a) fort.jpg (b) moon.png (c) bus.jpg (d) The full moon
  9. 9.📝 How many paragraphs does this code make?
    <p>I love mangoes.</p>
    <p>Cricket is fun.</p>
    <h2>Hello, world!</h2>
    <h2>Hello, world!</h2>
  10. 10.Which of these is true of a web browser? (a) shows line numbers (b) hosts websites online (c) turns HTML into a page (d) saves our .html files
  11. 11.📝 On how many lines does the browser show this paragraph?
    <p>Stars shine<br>Birds sing<br>Sky is blue<br>Roses are red<br>Kites fly high</p>
  12. 12.💬 Which text will NOT show on the page?
    <!-- <p>My pets</p> -->
    <p>The red kite</p>
    <p>Our school trip</p>
    (a) Our school trip (b) My pets (c) The red kite
  13. 13.📝 On how many lines does the browser show this paragraph?
    <p>Birds sing<br>Kites fly high<br>Stars shine<br>Roses are red</p>
  14. 14.📝 What does <hr> draw? (a) a link (b) a table (c) a line across the page (d) a picture
  15. 15.🔍 One closing tag is missing. Which one?
    <em>Rain today
    <h2>Hello, world!</h2>
    <h1>Cricket is fun.</h1>
    (a) </b> (b) </h1> (c) </em> (d) </h2>
  16. 16.📄 Can HTML on its own add pictures to a page? (a) Yes (b) No
  17. 17.🔠 Are headings shown in bold by default? (a) No (b) Yes
  18. 18.📋 Which list tag lists things in any order? (a) <li> (b) <ul> (c) <ol>
  19. 19.📋 How many items does this list show?
    <ul>
      <li>Grapes</li>
      <li>Litchi</li>
    </ul>
  20. 20.🔗 What does target="_blank" do to a link? (a) opens it in a new tab (b) makes it bold (c) hides the link (d) makes it blank
  21. 21.📝 On how many lines does the browser show this paragraph?
    <p>Sky is blue<br>Stars shine<br>Roses are red<br>Birds sing</p>
  22. 22.🖼️ Which attribute of <img> sets how wide it is? (a) alt (b) src (c) height (d) width
  23. 23.🔗 Where does this link open?
    <a href="maths.html" target="_blank">School news</a>
    (a) in the same tab (b) in a new tab
  24. 24.📄 Can HTML on its own run a game loop? (a) Yes (b) No
  25. 25.🔗 Where does this link open?
    <a href="maths.html">Contact us</a>
    (a) in the same tab (b) in a new tab
  26. 26.🔍 One closing tag is missing. Which one?
    <p>My best friend</p>
    <h2>Fun facts
    <em>Our school trip</em>
    (a) </em> (b) </h2> (c) </h1> (d) </p>
  27. 27.True or false: <style> goes in the head. (a) True (b) False
  28. 28.Which of these has a closing tag? (a) <img> (b) <h1> (c) <br> (d) <meta>
  29. 29.💬 Does the browser show comments on the page? (a) No (b) Yes
  30. 30.🔠 How many heading levels does HTML have? (a) 10 (b) 6 (c) 4 (d) 3
  31. 31.🔠 Which heading shows the SMALLEST text: <h6>, <h1>, <h5> or <h4>? (a) <h1> (b) <h5> (c) <h4> (d) <h6>
  32. 32.📝 Does <hr> have a closing tag, or is it an empty tag? (a) has a closing tag (b) an empty tag
  33. 33.🔗 Where does this link open?
    <a href="quiz.html">Art corner</a>
    (a) in a new tab (b) in the same tab
  34. 34.🔗 Which address opens when you click this link?
    <a href="contact.html">School news</a>
    (a) https://example.com (b) maths.html (c) School news (d) contact.html
  35. 35.🖼️ Which attribute of <img> sets how tall it is? (a) alt (b) height (c) width (d) src
  36. 36.🔗 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">
  37. 37.📋 Which list suits a shopping list in any order? (a) <hr> (b) <br> (c) <ul> (d) <ol>
  38. 38.💬 Can anyone read your comments by viewing the page source? (a) Yes (b) No
  39. 39.True or false: <ul> lists things in any order. (a) False (b) True
  40. 40.💬 How many paragraphs show on the page?
    <p>My pets</p>
    <p>The red kite</p>
    <p>My best friend</p>
    <!-- <p>I love mangoes.</p> -->
    <p>Rain today</p>

Answer key

  1. </i>
  2. <a>
  3. href
  4. <head>
  5. </html>
  6. 1
  7. False
  8. moon.png
  9. 2
  10. turns HTML into a page
  11. 5
  12. My pets
  13. 4
  14. a line across the page
  15. </em>
  16. Yes
  17. Yes
  18. <ul>
  19. 2
  20. opens it in a new tab
  21. 4
  22. width
  23. in a new tab
  24. No
  25. in the same tab
  26. </h2>
  27. True
  28. <h1>
  29. No
  30. 6
  31. <h6>
  32. an empty tag
  33. in the same tab
  34. contact.html
  35. height
  36. <a href="about.html">
  37. <ul>
  38. Yes
  39. True
  40. 4

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