← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 587 · 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.📝 On how many lines does the browser show this paragraph?
    <p>Birds sing<br>Sky is blue<br>Roses are red<br>Rivers flow<br>Kites fly high</p>
  2. 2.📄 Can HTML on its own count button clicks? (a) Yes (b) No
  3. 3.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="dog.jpg" alt="A happy dog" width="200">
    (a) dog.jpg (b) width (c) A happy dog (d) The full moon
  4. 4.🖼️ Does <img> need a closing tag? (a) Yes (b) No
  5. 5.🌐 Which one is where we type code? (a) a web browser (b) a web server (c) a code editor
  6. 6.🔗 Which address opens when you click this link?
    <a href="games.html">Art corner</a>
    (a) games.html (b) Art corner (c) contact.html (d) about.html
  7. 7.Which of these goes in the body? (a) <style> (b) <meta charset="utf-8"> (c) <title> (d) <a>
  8. 8.📝 Does <br> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
  9. 9.🔍 Which is the odd one out? (a) shows line numbers (b) stores a website’s files (c) saves our .html files (d) is where we type code
  10. 10.True or false: <link rel="stylesheet"> goes in the head. (a) False (b) True
  11. 11.🔍 Which is the odd one out? (a) opens web pages for us (b) sends pages over the net (c) has an address bar (d) shows pages from the web
  12. 12.True or false: in <img>, height sets how tall it is. (a) False (b) True
  13. 13.🔍 Which is the odd one out? (a) has an address bar (b) saves our .html files (c) opens web pages for us (d) shows pages from the web
  14. 14.🔗 Which address opens when you click this link?
    <a href="art.html">Maths fun</a>
    (a) quiz.html (b) Maths fun (c) art.html (d) news.html
  15. 15.📄 Where does the text of <title> appear? (a) at the bottom (b) on the browser tab (c) nowhere (d) in a big heading
  16. 16.📄 Where does <style> go: in the head or in the body? (a) in the head (b) in the body
  17. 17.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="map.png" alt="Map of India" width="150">
    (a) Birthday cake (b) map.png (c) width (d) Map of India
  18. 18.True or false: in <img>, src names the picture file. (a) False (b) True
  19. 19.📋 What number does the browser show next to “Guava”?
    <ol start="5">
      <li>Banana</li>
      <li>Guava</li>
      <li>Orange</li>
    </ol>
  20. 20.🏷️ Which is the closing tag for <h1>? (a) <h1> (b) <h1/> (c) </h1> (d) <\h1>
  21. 21.🔠 Which tag is used for the main title on a page? (a) <br> (b) <h6> (c) <h1> (d) <p>
  22. 22.True or false: <h1> has a closing tag. (a) False (b) True
  23. 23.🖼️ How many pixels wide is the picture drawn?
    <img src="bus.jpg" alt="Our school bus" width="50">
  24. 24.💬 How many paragraphs show on the page?
    <p>I love mangoes.</p>
    <p>My best friend</p>
    <!-- <p>Fun facts</p> -->
  25. 25.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="tiger.jpg" alt="A tiger asleep" width="150">
    (a) width (b) A tiger asleep (c) A red kite (d) tiger.jpg
  26. 26.💬 Does the browser show comments on the page? (a) No (b) Yes
  27. 27.Which of these is true of a web browser? (a) sends pages over the net (b) is where we type code (c) opens web pages for us (d) saves our .html files
  28. 28.Which of these is true of a web browser? (a) hosts websites online (b) turns HTML into a page (c) sends pages over the net (d) shows line numbers
  29. 29.🌐 Which one saves our .html files? (a) a web server (b) a web browser (c) a code editor
  30. 30.Which of these is a closing tag? (a) <li> (b) <body> (c) </title> (d) <p>
  31. 31.🖼️ Which attribute of <img> describes the picture? (a) width (b) src (c) alt (d) height
  32. 32.📝 On how many lines does the browser show this paragraph?
    <p>Rivers flow<br>Stars shine<br>Birds sing</p>
  33. 33.🧱 HTML gives a web page its ___. (a) speed (b) colours (c) structure (d) sound
  34. 34.📄 What is the big heading shown on this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>My Hobbies</title>
    </head>
    <body>
      <h1>Easy snacks</h1>
      <p>I like to read.</p>
    </body>
    </html>
    (a) body (b) I like to read. (c) My Hobbies (d) Easy snacks
  35. 35.🖼️ Which attribute of <img> is read by screen readers? (a) width (b) src (c) height (d) alt
  36. 36.💬 How many paragraphs show on the page?
    <!-- <p>The red kite</p> -->
    <p>Rain today</p>
    <p>Our school trip</p>
  37. 37.🔗 Which words do you click on?
    <a href="contact.html">Play games</a>
    (a) Play games (b) About us (c) contact.html (d) href
  38. 38.💬 How many paragraphs show on the page?
    <!-- <p>The red kite</p> -->
    <p>My pets</p>
    <p>Rain today</p>
    <!-- <p>Cricket is fun.</p> -->
  39. 39.📝 How many paragraphs does this code make?
    <p>Hello, world!</p>
    <p>My best friend</p>
    <p>Fun facts</p>
    <h2>Rain today</h2>
    <h2>Hello, world!</h2>
  40. 40.💬 How does an HTML comment start? (a) # (b) <!-- (c) /* (d) //

Answer key

  1. 5
  2. No
  3. A happy dog
  4. No
  5. a code editor
  6. games.html
  7. <a>
  8. an empty tag
  9. stores a website’s files
  10. True
  11. sends pages over the net
  12. True
  13. saves our .html files
  14. art.html
  15. on the browser tab
  16. in the head
  17. Map of India
  18. True
  19. 6
  20. </h1>
  21. <h1>
  22. True
  23. 50
  24. 2
  25. A tiger asleep
  26. No
  27. opens web pages for us
  28. turns HTML into a page
  29. a code editor
  30. </title>
  31. alt
  32. 3
  33. structure
  34. Easy snacks
  35. alt
  36. 2
  37. Play games
  38. 2
  39. 3
  40. <!--

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