← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 473 · 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="contact.html">Contact us</a>
    (a) contact.html (b) Contact us (c) Visit the site (d) href
  2. 2.📝 What does <hr> draw? (a) a picture (b) a line across the page (c) a table (d) a link
  3. 3.📝 How many paragraphs does this code make?
    <p>Hello, world!</p>
    <p>My best friend</p>
    <p>My pets</p>
    <p>Rain today</p>
  4. 4.🔢 In a basic web page file, which comes first: “<head>” or “<!DOCTYPE html>”? (a) <head> (b) <!DOCTYPE html>
  5. 5.True or false: in <img>, height sets how tall it is. (a) False (b) True
  6. 6.📋 Which list shows the steps of a recipe best? (a) <br> (b) <ul> (c) <hr> (d) <ol>
  7. 7.🔍 One closing tag is missing. Which one?
    <h1>Our school trip
    <b>Hello, world!</b>
    <i>The red kite</i>
    (a) </h1> (b) </small> (c) </b> (d) </i>
  8. 8.💬 How many paragraphs show on the page?
    <!-- <p>Hello, world!</p> -->
    <!-- <p>My best friend</p> -->
    <p>Good morning!</p>
    <!-- <p>Fun facts</p> -->
  9. 9.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="moon.png" alt="The full moon" width="50">
    (a) moon.png (b) Our school bus (c) The full moon (d) width
  10. 10.🔢 In a basic web page file, which comes FIRST? (a) </body> (b) </html> (c) <head> (d) <!DOCTYPE html>
  11. 11.🖼️ Which attribute of <img> describes the picture? (a) alt (b) width (c) height (d) src
  12. 12.📄 Can HTML on its own keep a high score? (a) Yes (b) No
  13. 13.🔠 Which heading shows the BIGGEST text: <h4>, <h5>, <h3> or <h2>? (a) <h5> (b) <h3> (c) <h4> (d) <h2>
  14. 14.Which of these goes in the body? (a) <style> (b) <title> (c) <p> (d) <link rel="stylesheet">
  15. 15.🏷️ Is </b> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
  16. 16.🔗 Which words do you click on?
    <a href="news.html">Maths fun</a>
    (a) href (b) news.html (c) Maths fun (d) Art corner
  17. 17.Which of these is true of a code editor? (a) stores a website’s files (b) colours code to help us (c) answers page requests (d) turns HTML into a page
  18. 18.📋 How many items does this list show?
    <ol>
      <li>Guava</li>
      <li>Jamun</li>
      <li>Grapes</li>
    </ol>
  19. 19.🔗 Where does this link open?
    <a href="contact.html" target="_blank">Visit the site</a>
    (a) in the same tab (b) in a new tab
  20. 20.🔗 What does target="_blank" do to a link? (a) hides the link (b) opens it in a new tab (c) makes it bold (d) makes it blank
  21. 21.🔠 How many headings are in this code?
    <h1>Cricket is fun.</h1>
    <p>Good morning!</p>
    <h4>My pets</h4>
    <p>The red kite</p>
    <h2>Fun facts</h2>
  22. 22.Which of these is a closing tag? (a) </body> (b) <body> (c) <h1> (d) <b>
  23. 23.🔠 How many heading levels does HTML have? (a) 3 (b) 10 (c) 4 (d) 6
  24. 24.📝 On how many lines does the browser show this paragraph?
    <p>Rivers flow<br>Roses are red<br>Kites fly high<br>Birds sing<br>Sky is blue</p>
  25. 25.📄 Where does the text of <title> appear? (a) in a big heading (b) on the browser tab (c) at the bottom (d) nowhere
  26. 26.📝 Does <h1> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
  27. 27.💬 Which text will NOT show on the page?
    <p>My pets</p>
    <p>I love mangoes.</p>
    <!-- <p>My best friend</p> -->
    (a) My pets (b) My best friend (c) I love mangoes.
  28. 28.📛 In <a href="x.html">, what is href? (a) an attribute (b) an element name (c) a closing tag (d) a comment
  29. 29.🖼️ Which attribute of <img> sets how tall it is? (a) width (b) src (c) alt (d) height
  30. 30.🏷️ Which is the closing tag for <small>? (a) <small/> (b) </small> (c) <\small> (d) <small>
  31. 31.💬 How many paragraphs show on the page?
    <!-- <p>Hello, world!</p> -->
    <p>My best friend</p>
    <!-- <p>I love mangoes.</p> -->
  32. 32.🔠 Which heading shows the BIGGEST text: <h5>, <h3>, <h6> or <h4>? (a) <h5> (b) <h3> (c) <h6> (d) <h4>
  33. 33.🔗 Which words do you click on?
    <a href="games.html">School news</a>
    (a) games.html (b) Take the quiz (c) href (d) School news
  34. 34.🏷️ Every HTML tag starts with which sign? (a) { (b) < (c) [ (d) (
  35. 35.🔗 Which code links to about.html? (a) <a src="about.html"> (b) <a alt="about.html"> (c) <a href="about.html"> (d) <link about.html>
  36. 36.🖼️ 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
  37. 37.🔗 Which address opens when you click this link?
    <a href="games.html">Visit the site</a>
    (a) Visit the site (b) contact.html (c) about.html (d) games.html
  38. 38.📄 What is the first line of an HTML5 page? (a) <head> (b) <html> (c) <!DOCTYPE html> (d) <body>
  39. 39.💬 Why do coders write comments? (a) to add colour (b) to leave notes (c) to show pictures (d) to make links
  40. 40.🔗 Which words do you click on?
    <a href="games.html">Visit the site</a>
    (a) games.html (b) Maths fun (c) Visit the site (d) href

Answer key

  1. Contact us
  2. a line across the page
  3. 4
  4. <!DOCTYPE html>
  5. True
  6. <ol>
  7. </h1>
  8. 1
  9. The full moon
  10. <!DOCTYPE html>
  11. alt
  12. No
  13. <h2>
  14. <p>
  15. a closing tag
  16. Maths fun
  17. colours code to help us
  18. 3
  19. in a new tab
  20. opens it in a new tab
  21. 3
  22. </body>
  23. 6
  24. 5
  25. on the browser tab
  26. has a closing tag
  27. My best friend
  28. an attribute
  29. height
  30. </small>
  31. 1
  32. <h3>
  33. School news
  34. <
  35. <a href="about.html">
  36. to describe the image
  37. games.html
  38. <!DOCTYPE html>
  39. to leave notes
  40. Visit the site

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