← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 965 · 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.🔠 How many headings are in this code?
    <h1>My pets</h1>
    <p>I love mangoes.</p>
    <h3>The red kite</h3>
    <h3>Cricket is fun.</h3>
  2. 2.🖼️ Why do we add alt text to an image? (a) to describe the image (b) to colour it (c) to load it faster (d) to make it bigger
  3. 3.🏷️ What does a closing tag have that an opening tag does not? (a) a dot . (b) a dollar $ (c) a hash # (d) a slash /
  4. 4.📄 What is the big heading shown on this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Art Gallery</title>
    </head>
    <body>
      <h1>Match report</h1>
      <p>We won by 5 runs.</p>
    </body>
    </html>
    (a) Match report (b) Art Gallery (c) We won by 5 runs. (d) body
  5. 5.🔍 Which line is missing its closing tag?
    line 1: <small>My pets</small>
    line 2: <p>Hello, world!</p>
    line 3: <h1>Good morning!
    (a) line 1 (b) line 3 (c) line 2
  6. 6.📝 How many paragraphs does this code make?
    <p>Fun facts</p>
    <h2>My best friend</h2>
    <p>Hello, world!</p>
    <p>The red kite</p>
  7. 7.🔗 Which attribute holds the address of a link? (a) id (b) href (c) alt (d) src
  8. 8.True or false: a code editor opens web pages for us. (a) True (b) False
  9. 9.Which of these has a closing tag? (a) <input> (b) <meta> (c) <br> (d) <title>
  10. 10.💬 Can anyone read your comments by viewing the page source? (a) Yes (b) No
  11. 11.Which of these goes in the body? (a) <title> (b) <meta charset="utf-8"> (c) <ul> (d) <style>
  12. 12.🖼️ How many pixels wide is the picture drawn?
    <img src="kite.png" alt="A red kite" width="350">
  13. 13.🔠 Which heading shows the BIGGEST text: <h3>, <h1>, <h4> or <h2>? (a) <h2> (b) <h1> (c) <h4> (d) <h3>
  14. 14.🖼️ Which attribute of <img> shows if the image fails? (a) alt (b) height (c) src (d) width
  15. 15.Which of these is true of a code editor? (a) opens web pages for us (b) turns HTML into a page (c) saves our .html files (d) hosts websites online
  16. 16.📋 What number does the browser show next to “Papaya”?
    <ol>
      <li>Guava</li>
      <li>Mango</li>
      <li>Papaya</li>
    </ol>
  17. 17.🖼️ Which attribute of <img> tells which image to load? (a) height (b) src (c) alt (d) width
  18. 18.💬 Does the browser show comments on the page? (a) No (b) Yes
  19. 19.Which of these is true of a web browser? (a) has an address bar (b) shows line numbers (c) sends pages over the net (d) stores a website’s files
  20. 20.💬 How does an HTML comment start? (a) /* (b) // (c) # (d) <!--
  21. 21.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="fort.jpg" alt="An old fort" width="150">
    (a) An old fort (b) A tiger asleep (c) width (d) fort.jpg
  22. 22.🔗 Which address opens when you click this link?
    <a href="news.html">Contact us</a>
    (a) news.html (b) games.html (c) Contact us (d) quiz.html
  23. 23.🔠 Which heading shows the BIGGEST text: <h1>, <h6>, <h2> or <h3>? (a) <h2> (b) <h1> (c) <h6> (d) <h3>
  24. 24.🔗 What does target="_blank" do to a link? (a) opens it in a new tab (b) makes it bold (c) makes it blank (d) hides the link
  25. 25.🔗 Which code links to about.html? (a) <link about.html> (b) <a alt="about.html"> (c) <a src="about.html"> (d) <a href="about.html">
  26. 26.🔍 Which line is missing its closing tag?
    line 1: <h2>The red kite</h2>
    line 2: <h1>I love mangoes.</h1>
    line 3: <p>My best friend
    (a) line 3 (b) line 1 (c) line 2
  27. 27.🔗 Which words do you click on?
    <a href="https://example.com">Play games</a>
    (a) href (b) Play games (c) About us (d) https://example.com
  28. 28.🔗 Where does this link open?
    <a href="contact.html" target="_blank">Art corner</a>
    (a) in the same tab (b) in a new tab
  29. 29.🔠 Which heading shows the SMALLEST text: <h4>, <h5>, <h3> or <h1>? (a) <h4> (b) <h1> (c) <h3> (d) <h5>
  30. 30.🖼️ Which tag puts a picture on a page? (a) <p> (b) <a> (c) <pic> (d) <img>
  31. 31.Which of these is true of a code editor? (a) stores a website’s files (b) shows line numbers (c) answers page requests (d) opens web pages for us
  32. 32.🔗 Which address opens when you click this link?
    <a href="https://example.com">Take the quiz</a>
    (a) art.html (b) https://example.com (c) maths.html (d) Take the quiz
  33. 33.🔢 In a basic web page file, which comes first: “<html>” or “</html>”? (a) </html> (b) <html>
  34. 34.True or false: <b> has a closing tag. (a) False (b) True
  35. 35.Which of these is true of a code editor? (a) stores a website’s files (b) has an address bar (c) is where we type code (d) shows pages from the web
  36. 36.🏷️ Is <h1> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
  37. 37.📝 Does <b> have a closing tag, or is it an empty tag? (a) has a closing tag (b) an empty tag
  38. 38.📝 What does <hr> draw? (a) a line across the page (b) a link (c) a picture (d) a table
  39. 39.🔗 Which words do you click on?
    <a href="art.html">Art corner</a>
    (a) School news (b) href (c) art.html (d) Art corner
  40. 40.📛 In <a href="x.html">, what is href? (a) an element name (b) a closing tag (c) an attribute (d) a comment

Answer key

  1. 3
  2. to describe the image
  3. a slash /
  4. Match report
  5. line 3
  6. 3
  7. href
  8. False
  9. <title>
  10. Yes
  11. <ul>
  12. 350
  13. <h1>
  14. alt
  15. saves our .html files
  16. 3
  17. src
  18. No
  19. has an address bar
  20. <!--
  21. An old fort
  22. news.html
  23. <h1>
  24. opens it in a new tab
  25. <a href="about.html">
  26. line 3
  27. Play games
  28. in a new tab
  29. <h5>
  30. <img>
  31. shows line numbers
  32. https://example.com
  33. <html>
  34. True
  35. is where we type code
  36. an opening tag
  37. has a closing tag
  38. a line across the page
  39. Art corner
  40. an attribute

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