← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 274 · 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 attribute holds the address of a link? (a) href (b) id (c) src (d) alt
  2. 2.📝 What does <hr> draw? (a) a picture (b) a table (c) a line across the page (d) a link
  3. 3.📝 On how many lines does the browser show this paragraph?
    <p>Stars shine<br>Sky is blue</p>
  4. 4.🔠 How many headings are in this code?
    <h1>I love mangoes.</h1>
    <h4>Rain today</h4>
    <h3>My best friend</h3>
    <h4>Our school trip</h4>
  5. 5.🔠 How many heading levels does HTML have? (a) 10 (b) 4 (c) 3 (d) 6
  6. 6.🏷️ Every HTML tag starts with which sign? (a) < (b) [ (c) { (d) (
  7. 7.🖼️ Does <img> need a closing tag? (a) Yes (b) No
  8. 8.🖼️ How many pixels wide is the picture drawn?
    <img src="tiger.jpg" alt="A tiger asleep" width="50">
  9. 9.True or false: <meta charset="utf-8"> goes in the head. (a) False (b) True
  10. 10.📄 What is the big heading shown on this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>My Hobbies</title>
    </head>
    <body>
      <h1>Match report</h1>
      <p>Try this poha.</p>
    </body>
    </html>
    (a) Try this poha. (b) body (c) My Hobbies (d) Match report
  11. 11.🔗 Which address opens when you click this link?
    <a href="https://example.com">Play games</a>
    (a) https://example.com (b) art.html (c) Play games (d) maths.html
  12. 12.🖼️ Why do we add alt text to an image? (a) to load it faster (b) to describe the image (c) to make it bigger (d) to colour it
  13. 13.📝 What does <br> do? (a) starts a new line (b) makes text bold (c) makes a list (d) adds a picture
  14. 14.🔗 Which tag makes a clickable link? (a) <img> (b) <link> (c) <p> (d) <a>
  15. 15.📝 What does <p> make? (a) a paragraph (b) a table (c) a link (d) a picture
  16. 16.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="dog.jpg" alt="A happy dog" width="100">
    (a) dog.jpg (b) width (c) A happy dog (d) The full moon
  17. 17.🖼️ Which attribute of <img> names the picture file? (a) width (b) height (c) src (d) alt
  18. 18.Which of these goes in the body? (a) <title> (b) <link rel="stylesheet"> (c) <table> (d) <style>
  19. 19.Which of these has a closing tag? (a) <img> (b) <meta> (c) <ul> (d) <input>
  20. 20.True or false: a web browser shows pages from the web. (a) True (b) False
  21. 21.Which of these is true of a code editor? (a) opens web pages for us (b) hosts websites online (c) shows pages from the web (d) is where we type code
  22. 22.🔠 How many headings are in this code?
    <h1>Good morning!</h1>
    <p>My pets</p>
    <h2>The red kite</h2>
    <h3>Hello, world!</h3>
    <h3>My pets</h3>
  23. 23.📋 Which list tag is one item of a list? (a) <li> (b) <ul> (c) <ol>
  24. 24.🔠 How many headings are in this code?
    <h1>I love mangoes.</h1>
    <p>Fun facts</p>
    <h3>My best friend</h3>
    <p>My best friend</p>
    <h3>The red kite</h3>
  25. 25.True or false: a code editor shows line numbers. (a) True (b) False
  26. 26.🔗 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
  27. 27.📄 Can HTML on its own keep a high score? (a) No (b) Yes
  28. 28.🔠 Which tag is the least important heading? (a) <p> (b) <h3> (c) <h1> (d) <h6>
  29. 29.True or false: in <img>, width sets how wide it is. (a) True (b) False
  30. 30.💬 How many paragraphs show on the page?
    <p>I love mangoes.</p>
    <p>Our school trip</p>
    <!-- <p>My best friend</p> -->
  31. 31.💬 How many paragraphs show on the page?
    <p>Rain today</p>
    <p>My pets</p>
    <!-- <p>Fun facts</p> -->
  32. 32.🌍 Which program shows a web page to us? (a) a paint program (b) a web browser (c) a music player (d) a calculator
  33. 33.🔠 Which heading shows the BIGGEST text: <h6>, <h4>, <h5> or <h1>? (a) <h5> (b) <h1> (c) <h6> (d) <h4>
  34. 34.🏷️ What does a closing tag have that an opening tag does not? (a) a slash / (b) a hash # (c) a dollar $ (d) a dot .
  35. 35.💬 How does an HTML comment start? (a) /* (b) // (c) <!-- (d) #
  36. 36.🖼️ Which picture file does the browser load?
    <img src="tiger.jpg" alt="A tiger asleep" width="350">
    (a) kite.png (b) map.png (c) A tiger asleep (d) tiger.jpg
  37. 37.🔠 Which heading shows the SMALLEST text: <h4>, <h3>, <h5> or <h2>? (a) <h5> (b) <h4> (c) <h3> (d) <h2>
  38. 38.True or false: <ol> lists things in any order. (a) True (b) False
  39. 39.📝 Does <ul> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
  40. 40.True or false: <style> goes in the body. (a) True (b) False

Answer key

  1. href
  2. a line across the page
  3. 2
  4. 4
  5. 6
  6. <
  7. No
  8. 50
  9. True
  10. Match report
  11. https://example.com
  12. to describe the image
  13. starts a new line
  14. <a>
  15. a paragraph
  16. A happy dog
  17. src
  18. <table>
  19. <ul>
  20. True
  21. is where we type code
  22. 4
  23. <li>
  24. 3
  25. True
  26. opens it in a new tab
  27. No
  28. <h6>
  29. True
  30. 2
  31. 2
  32. a web browser
  33. <h1>
  34. a slash /
  35. <!--
  36. tiger.jpg
  37. <h5>
  38. False
  39. has a closing tag
  40. False

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