← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 342 · 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 is the odd one out? (a) saves our .html files (b) turns HTML into a page (c) shows pages from the web (d) has an address bar
  2. 2.🔗 Which tag makes a clickable link? (a) <link> (b) <img> (c) <p> (d) <a>
  3. 3.🖼️ Which attribute of <img> describes the picture? (a) width (b) alt (c) src (d) height
  4. 4.🌐 Which one colours code to help us? (a) a code editor (b) a web server (c) a web browser
  5. 5.💬 How many paragraphs show on the page?
    <!-- <p>My best friend</p> -->
    <!-- <p>Fun facts</p> -->
    <p>The red kite</p>
    <p>I love mangoes.</p>
  6. 6.Which of these goes in the body? (a) <link rel="stylesheet"> (b) <title> (c) <meta charset="utf-8"> (d) <h1>
  7. 7.True or false: <input> has a closing tag. (a) False (b) True
  8. 8.🧩 An opening tag + content + a closing tag together make an ___. (a) editor (b) attribute (c) element (d) address
  9. 9.📄 What is the big heading shown on this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Space Facts</title>
    </head>
    <body>
      <h1>Welcome!</h1>
      <p>Thanks for visiting.</p>
    </body>
    </html>
    (a) Thanks for visiting. (b) body (c) Welcome! (d) Space Facts
  10. 10.💬 How does an HTML comment start? (a) # (b) /* (c) <!-- (d) //
  11. 11.📄 What is the big heading shown on this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>My Hobbies</title>
    </head>
    <body>
      <h1>All about me</h1>
      <p>I like to read.</p>
    </body>
    </html>
    (a) body (b) I like to read. (c) My Hobbies (d) All about me
  12. 12.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="bus.jpg" alt="Our school bus" width="200">
    (a) width (b) An old fort (c) Our school bus (d) bus.jpg
  13. 13.📄 What does the browser tab show for this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>My Hobbies</title>
    </head>
    <body>
      <h1>Match report</h1>
      <p>Here is my best one.</p>
    </body>
    </html>
    (a) Match report (b) Here is my best one. (c) My Hobbies (d) index.html
  14. 14.📋 Which list shows the steps of a recipe best? (a) <ul> (b) <hr> (c) <br> (d) <ol>
  15. 15.📝 Does <h1> have a closing tag, or is it an empty tag? (a) has a closing tag (b) an empty tag
  16. 16.📄 What does the browser tab show for this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Space Facts</title>
    </head>
    <body>
      <h1>Match report</h1>
      <p>We won by 5 runs.</p>
    </body>
    </html>
    (a) Space Facts (b) index.html (c) We won by 5 runs. (d) Match report
  17. 17.🔍 One closing tag is missing. Which one?
    <small>The red kite
    <i>I love mangoes.</i>
    <h1>My best friend</h1>
    (a) </h1> (b) </small> (c) </i> (d) </p>
  18. 18.🖼️ How many pixels wide is the picture drawn?
    <img src="kite.png" alt="A red kite" width="100">
  19. 19.🔠 Which heading shows the BIGGEST text: <h2>, <h5>, <h6> or <h1>? (a) <h2> (b) <h5> (c) <h1> (d) <h6>
  20. 20.🖼️ Which attribute of <img> tells which image to load? (a) height (b) width (c) alt (d) src
  21. 21.🔠 Which heading shows the SMALLEST text: <h4>, <h6>, <h1> or <h2>? (a) <h4> (b) <h1> (c) <h2> (d) <h6>
  22. 22.🖼️ Which picture file does the browser load?
    <img src="dog.jpg" alt="A happy dog" width="150">
    (a) dog.jpg (b) bus.jpg (c) A happy dog (d) moon.png
  23. 23.📄 Where does <meta charset="utf-8"> go: in the head or in the body? (a) in the body (b) in the head
  24. 24.🏷️ Is </title> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
  25. 25.📝 You type 5 spaces between two words in a <p>. How does the browser show them? (a) as one space (b) as a new line (c) as 5 spaces (d) as a dot
  26. 26.🔗 Which address opens when you click this link?
    <a href="about.html">Play games</a>
    (a) contact.html (b) about.html (c) Play games (d) https://example.com
  27. 27.🔍 One closing tag is missing. Which one?
    <em>The red kite</em>
    <h1>I love mangoes.</h1>
    <small>Cricket is fun.
    (a) </h1> (b) </strong> (c) </small> (d) </em>
  28. 28.True or false: in <img>, src is read by screen readers. (a) True (b) False
  29. 29.🔗 Which address opens when you click this link?
    <a href="quiz.html">Play games</a>
    (a) games.html (b) about.html (c) Play games (d) quiz.html
  30. 30.🔍 Which is the odd one out? (a) opens web pages for us (b) shows pages from the web (c) has an address bar (d) hosts websites online
  31. 31.🔠 How many heading levels does HTML have? (a) 6 (b) 4 (c) 10 (d) 3
  32. 32.🔗 Where does this link open?
    <a href="news.html">Maths fun</a>
    (a) in a new tab (b) in the same tab
  33. 33.🔗 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
  34. 34.🖼️ Which attribute of <img> sets how wide it is? (a) src (b) width (c) height (d) alt
  35. 35.💬 Why do coders write comments? (a) to leave notes (b) to add colour (c) to show pictures (d) to make links
  36. 36.🔗 Where does this link open?
    <a href="about.html" target="_blank">Play games</a>
    (a) in a new tab (b) in the same tab
  37. 37.🔠 How many headings are in this code?
    <h1>Our school trip</h1>
    <p>Hello, world!</p>
    <h2>The red kite</h2>
  38. 38.📄 Where does the text of <title> appear? (a) on the browser tab (b) at the bottom (c) nowhere (d) in a big heading
  39. 39.🌐 Which one answers page requests? (a) a web browser (b) a code editor (c) a web server
  40. 40.💬 Which text will NOT show on the page?
    <!-- <p>Hello, world!</p> -->
    <p>Good morning!</p>
    <p>Rain today</p>
    (a) Rain today (b) Hello, world! (c) Good morning!

Answer key

  1. saves our .html files
  2. <a>
  3. alt
  4. a code editor
  5. 2
  6. <h1>
  7. False
  8. element
  9. Welcome!
  10. <!--
  11. All about me
  12. Our school bus
  13. My Hobbies
  14. <ol>
  15. has a closing tag
  16. Space Facts
  17. </small>
  18. 100
  19. <h1>
  20. src
  21. <h6>
  22. dog.jpg
  23. in the head
  24. a closing tag
  25. as one space
  26. about.html
  27. </small>
  28. False
  29. quiz.html
  30. hosts websites online
  31. 6
  32. in the same tab
  33. in a new tab
  34. width
  35. to leave notes
  36. in a new tab
  37. 2
  38. on the browser tab
  39. a web server
  40. Hello, world!

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