← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 228 · 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 pixels wide is the picture drawn?
    <img src="bus.jpg" alt="Our school bus" width="100">
  2. 2.🔗 Where does this link open?
    <a href="games.html" target="_blank">Art corner</a>
    (a) in a new tab (b) in the same tab
  3. 3.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="cake.jpg" alt="Birthday cake" width="200">
    (a) Birthday cake (b) cake.jpg (c) width (d) A happy dog
  4. 4.📝 You type 5 spaces between two words in a <p>. How does the browser show them? (a) as 5 spaces (b) as a new line (c) as one space (d) as a dot
  5. 5.💬 Which text will NOT show on the page?
    <!-- <p>I love mangoes.</p> -->
    <p>Rain today</p>
    <p>Fun facts</p>
    <p>Hello, world!</p>
    (a) Fun facts (b) I love mangoes. (c) Hello, world! (d) Rain today
  6. 6.🔗 Which attribute holds the address of a link? (a) src (b) href (c) alt (d) id
  7. 7.📄 Can HTML on its own make links to pages? (a) No (b) Yes
  8. 8.🖼️ Does <img> need a closing tag? (a) No (b) Yes
  9. 9.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="tiger.jpg" alt="A tiger asleep" width="300">
    (a) A red kite (b) tiger.jpg (c) width (d) A tiger asleep
  10. 10.🔍 One closing tag is missing. Which one?
    <small>Our school trip</small>
    <h1>My pets</h1>
    <h2>I love mangoes.
    (a) </h1> (b) </h2> (c) </small> (d) </b>
  11. 11.💬 How many paragraphs show on the page?
    <p>Good morning!</p>
    <p>Cricket is fun.</p>
    <!-- <p>Hello, world!</p> -->
    <!-- <p>My best friend</p> -->
    <!-- <p>I love mangoes.</p> -->
  12. 12.🏷️ What does a closing tag have that an opening tag does not? (a) a hash # (b) a dot . (c) a dollar $ (d) a slash /
  13. 13.True or false: <li> is an empty tag. (a) True (b) False
  14. 14.🏷️ Is </title> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
  15. 15.🔍 Which is the odd one out? (a) shows line numbers (b) is where we type code (c) saves our .html files (d) turns HTML into a page
  16. 16.📄 Can HTML on its own show paragraphs? (a) No (b) Yes
  17. 17.🖼️ Why do we add alt text to an image? (a) to make it bigger (b) to colour it (c) to describe the image (d) to load it faster
  18. 18.📝 Does <li> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
  19. 19.🔠 How many headings are in this code?
    <h1>Fun facts</h1>
    <h2>Our school trip</h2>
    <p>Good morning!</p>
    <h3>Cricket is fun.</h3>
  20. 20.🖼️ Which picture file does the browser load?
    <img src="bus.jpg" alt="Our school bus" width="400">
    (a) Our school bus (b) fort.jpg (c) bus.jpg (d) tiger.jpg
  21. 21.True or false: <input> has a closing tag. (a) False (b) True
  22. 22.🔠 Which heading shows the BIGGEST text: <h2>, <h6>, <h4> or <h3>? (a) <h3> (b) <h2> (c) <h4> (d) <h6>
  23. 23.📝 What does <hr> draw? (a) a line across the page (b) a picture (c) a table (d) a link
  24. 24.🏷️ Which is the closing tag for <strong>? (a) <strong/> (b) <\strong> (c) <strong> (d) </strong>
  25. 25.💬 Which text will NOT show on the page?
    <p>I love mangoes.</p>
    <p>Our school trip</p>
    <p>My best friend</p>
    <!-- <p>The red kite</p> -->
    (a) My best friend (b) I love mangoes. (c) The red kite (d) Our school trip
  26. 26.💬 Which text will NOT show on the page?
    <p>Good morning!</p>
    <p>The red kite</p>
    <!-- <p>My best friend</p> -->
    (a) The red kite (b) My best friend (c) Good morning!
  27. 27.📋 Which list tag lists things in any order? (a) <li> (b) <ul> (c) <ol>
  28. 28.🔍 One closing tag is missing. Which one?
    <u>I love mangoes.</u>
    <h2>Good morning!</h2>
    <p>My pets
    (a) </h1> (b) </p> (c) </h2> (d) </u>
  29. 29.📋 Which list suits a shopping list in any order? (a) <ol> (b) <br> (c) <hr> (d) <ul>
  30. 30.💬 Which text will NOT show on the page?
    <p>Hello, world!</p>
    <p>My best friend</p>
    <!-- <p>Cricket is fun.</p> -->
    (a) Hello, world! (b) My best friend (c) Cricket is fun.
  31. 31.💾 A web page file usually ends with which extension? (a) .png (b) .mp3 (c) .html (d) .txt
  32. 32.🔗 Which words do you click on?
    <a href="news.html">Visit the site</a>
    (a) news.html (b) href (c) Maths fun (d) Visit the site
  33. 33.🔗 Where does this link open?
    <a href="https://example.com">Art corner</a>
    (a) in the same tab (b) in a new tab
  34. 34.💬 How many paragraphs show on the page?
    <!-- <p>My pets</p> -->
    <p>Good morning!</p>
    <p>I love mangoes.</p>
    <!-- <p>Rain today</p> -->
    <!-- <p>Hello, world!</p> -->
  35. 35.Which of these is true of a code editor? (a) saves our .html files (b) answers page requests (c) has an address bar (d) turns HTML into a page
  36. 36.🌐 Which one colours code to help us? (a) a web browser (b) a web server (c) a code editor
  37. 37.📝 How many paragraphs does this code make?
    <p>Good morning!</p>
    <h2>My best friend</h2>
    <p>My pets</p>
    <p>The red kite</p>
    <p>My pets</p>
  38. 38.📋 Does this list show bullets or numbers?
    <ul>
      <li>Litchi</li>
      <li>Guava</li>
    </ul>
    (a) numbers (b) bullets
  39. 39.📝 How many paragraphs does this code make?
    <p>Fun facts</p>
    <h2>My pets</h2>
    <h2>Hello, world!</h2>
    <p>Good morning!</p>
    <h2>Our school trip</h2>
    <p>Cricket is fun.</p>
  40. 40.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="cake.jpg" alt="Birthday cake" width="300">
    (a) cake.jpg (b) A happy dog (c) width (d) Birthday cake

Answer key

  1. 100
  2. in a new tab
  3. Birthday cake
  4. as one space
  5. I love mangoes.
  6. href
  7. Yes
  8. No
  9. A tiger asleep
  10. </h2>
  11. 2
  12. a slash /
  13. False
  14. a closing tag
  15. turns HTML into a page
  16. Yes
  17. to describe the image
  18. has a closing tag
  19. 3
  20. bus.jpg
  21. False
  22. <h2>
  23. a line across the page
  24. </strong>
  25. The red kite
  26. My best friend
  27. <ul>
  28. </p>
  29. <ul>
  30. Cricket is fun.
  31. .html
  32. Visit the site
  33. in the same tab
  34. 2
  35. saves our .html files
  36. a code editor
  37. 4
  38. bullets
  39. 3
  40. Birthday cake

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