← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 390 · 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.🔠 Are headings shown in bold by default? (a) No (b) Yes
  2. 2.💬 How many paragraphs show on the page?
    <p>The red kite</p>
    <p>Rain today</p>
    <!-- <p>I love mangoes.</p> -->
  3. 3.💬 Why do coders write comments? (a) to make links (b) to leave notes (c) to add colour (d) to show pictures
  4. 4.🔠 How many <h1> headings should a page usually have? (a) 10 (b) 6 (c) 3 (d) 1
  5. 5.📝 What does <br> do? (a) adds a picture (b) makes text bold (c) starts a new line (d) makes a list
  6. 6.True or false: <ul> is an unordered list. (a) True (b) False
  7. 7.🖼️ Which attribute of <img> tells which image to load? (a) alt (b) src (c) height (d) width
  8. 8.🖼️ Which picture file does the browser load?
    <img src="tiger.jpg" alt="A tiger asleep" width="200">
    (a) A tiger asleep (b) tiger.jpg (c) kite.png (d) map.png
  9. 9.🔠 Which tag is the least important heading? (a) <h3> (b) <p> (c) <h1> (d) <h6>
  10. 10.True or false: <ol> is one item of a list. (a) True (b) False
  11. 11.🔗 Which words do you click on?
    <a href="about.html">Maths fun</a>
    (a) href (b) about.html (c) Maths fun (d) Art corner
  12. 12.🔗 Which words do you click on?
    <a href="art.html">Maths fun</a>
    (a) art.html (b) href (c) Art corner (d) Maths fun
  13. 13.🔢 In a basic web page file, which comes first: “<body>” or “</body>”? (a) </body> (b) <body>
  14. 14.📄 What is the big heading shown on this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Class 7 Blog</title>
    </head>
    <body>
      <h1>My drawings</h1>
      <p>Try this poha.</p>
    </body>
    </html>
    (a) Try this poha. (b) My drawings (c) Class 7 Blog (d) body
  15. 15.📄 What is the big heading shown on this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Cricket Club</title>
    </head>
    <body>
      <h1>Welcome!</h1>
      <p>Here is my best one.</p>
    </body>
    </html>
    (a) Cricket Club (b) Welcome! (c) Here is my best one. (d) body
  16. 16.💬 How does an HTML comment start? (a) <!-- (b) # (c) // (d) /*
  17. 17.💬 Can anyone read your comments by viewing the page source? (a) Yes (b) No
  18. 18.🔢 In a basic web page file, which comes first: “<!DOCTYPE html>” or “<body>”? (a) <body> (b) <!DOCTYPE html>
  19. 19.💬 How does an HTML comment end? (a) // (b) --> (c) */ (d) >>
  20. 20.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="cake.jpg" alt="Birthday cake" width="50">
    (a) width (b) cake.jpg (c) Birthday cake (d) A happy dog
  21. 21.Which of these is true of a web browser? (a) colours code to help us (b) shows pages from the web (c) saves our .html files (d) hosts websites online
  22. 22.Which of these has a closing tag? (a) <img> (b) <b> (c) <hr> (d) <meta>
  23. 23.🔠 How many heading levels does HTML have? (a) 4 (b) 3 (c) 10 (d) 6
  24. 24.🌐 Which one turns HTML into a page? (a) a code editor (b) a web browser (c) a web server
  25. 25.🔗 Which address opens when you click this link?
    <a href="about.html">Take the quiz</a>
    (a) Take the quiz (b) https://example.com (c) contact.html (d) about.html
  26. 26.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="moon.png" alt="The full moon" width="100">
    (a) The full moon (b) Our school bus (c) moon.png (d) width
  27. 27.📋 How many items does this list show?
    <ul>
      <li>Jamun</li>
      <li>Banana</li>
      <li>Orange</li>
      <li>Grapes</li>
    </ul>
  28. 28.Which of these is a closing tag? (a) <h1> (b) <li> (c) </p> (d) <title>
  29. 29.True or false: in <img>, src names the picture file. (a) True (b) False
  30. 30.🔗 Where does this link open?
    <a href="about.html">School news</a>
    (a) in a new tab (b) in the same tab
  31. 31.📝 You type 5 spaces between two words in a <p>. How does the browser show them? (a) as 5 spaces (b) as a dot (c) as one space (d) as a new line
  32. 32.Which of these has a closing tag? (a) <ul> (b) <hr> (c) <input> (d) <img>
  33. 33.📋 What number does the browser show next to “Papaya”?
    <ol>
      <li>Grapes</li>
      <li>Litchi</li>
      <li>Banana</li>
      <li>Papaya</li>
    </ol>
  34. 34.💬 Which text will NOT show on the page?
    <p>I love mangoes.</p>
    <p>Our school trip</p>
    <!-- <p>Cricket is fun.</p> -->
    <p>Fun facts</p>
    (a) I love mangoes. (b) Our school trip (c) Fun facts (d) Cricket is fun.
  35. 35.Which of these has a closing tag? (a) <li> (b) <input> (c) <hr> (d) <meta>
  36. 36.🔡 Are HTML tag names usually written in small letters? (a) No (b) Yes
  37. 37.📝 What do we need to write HTML? (a) a microphone (b) a printer (c) a plain text editor (d) a paintbrush
  38. 38.📝 How many paragraphs does this code make?
    <p>The red kite</p>
    <p>Hello, world!</p>
    <p>My pets</p>
    <p>I love mangoes.</p>
    <h2>Cricket is fun.</h2>
    <p>My pets</p>
  39. 39.🔗 Which words do you click on?
    <a href="https://example.com">Take the quiz</a>
    (a) Play games (b) Take the quiz (c) https://example.com (d) href
  40. 40.📋 Which list suits a shopping list in any order? (a) <ol> (b) <ul> (c) <br> (d) <hr>

Answer key

  1. Yes
  2. 2
  3. to leave notes
  4. 1
  5. starts a new line
  6. True
  7. src
  8. tiger.jpg
  9. <h6>
  10. False
  11. Maths fun
  12. Maths fun
  13. <body>
  14. My drawings
  15. Welcome!
  16. <!--
  17. Yes
  18. <!DOCTYPE html>
  19. -->
  20. Birthday cake
  21. shows pages from the web
  22. <b>
  23. 6
  24. a web browser
  25. about.html
  26. The full moon
  27. 4
  28. </p>
  29. True
  30. in the same tab
  31. as one space
  32. <ul>
  33. 4
  34. Cricket is fun.
  35. <li>
  36. Yes
  37. a plain text editor
  38. 5
  39. Take the quiz
  40. <ul>

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