← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 168 · 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.True or false: <h1> goes in the head. (a) False (b) True
  2. 2.🏷️ Which is the closing tag for <h1>? (a) <\h1> (b) </h1> (c) <h1/> (d) <h1>
  3. 3.📄 What is the first line of an HTML5 page? (a) <!DOCTYPE html> (b) <body> (c) <head> (d) <html>
  4. 4.💬 How does an HTML comment start? (a) <!-- (b) // (c) # (d) /*
  5. 5.📝 On how many lines does the browser show this paragraph?
    <p>Rivers flow<br>Roses are red<br>Sky is blue<br>Stars shine</p>
  6. 6.📝 On how many lines does the browser show this paragraph?
    <p>Sky is blue<br>Birds sing<br>Rivers flow<br>Stars shine</p>
  7. 7.💬 Why do coders write comments? (a) to add colour (b) to leave notes (c) to show pictures (d) to make links
  8. 8.🧩 An opening tag + content + a closing tag together make an ___. (a) element (b) attribute (c) address (d) editor
  9. 9.📄 What does the browser tab show for this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Space Facts</title>
    </head>
    <body>
      <h1>My drawings</h1>
      <p>Mars is red.</p>
    </body>
    </html>
    (a) Space Facts (b) My drawings (c) Mars is red. (d) index.html
  10. 10.📄 Can HTML on its own make bullet lists? (a) Yes (b) No
  11. 11.True or false: <h1> is an empty tag. (a) True (b) False
  12. 12.🔗 Where does this link open?
    <a href="art.html">Visit the site</a>
    (a) in a new tab (b) in the same tab
  13. 13.True or false: in <img>, alt describes the picture. (a) False (b) True
  14. 14.📋 Which list tag is one item of a list? (a) <li> (b) <ul> (c) <ol>
  15. 15.💬 Which text will NOT show on the page?
    <p>Hello, world!</p>
    <!-- <p>The red kite</p> -->
    <p>Our school trip</p>
    <p>My best friend</p>
    (a) Hello, world! (b) My best friend (c) Our school trip (d) The red kite
  16. 16.📝 How many paragraphs does this code make?
    <p>Hello, world!</p>
    <p>Fun facts</p>
    <h2>Cricket is fun.</h2>
    <p>Good morning!</p>
  17. 17.Which of these is an opening tag? (a) </p> (b) </li> (c) <b> (d) </b>
  18. 18.Which of these is a closing tag? (a) </h1> (b) <body> (c) <title> (d) <p>
  19. 19.🔍 One closing tag is missing. Which one?
    <p>Fun facts</p>
    <small>I love mangoes.
    <strong>Our school trip</strong>
    (a) </small> (b) </p> (c) </strong> (d) </h1>
  20. 20.🔍 Which line is missing its closing tag?
    line 1: <h3>Good morning!</h3>
    line 2: <em>My best friend
    line 3: <small>Hello, world!</small>
    (a) line 3 (b) line 2 (c) line 1
  21. 21.🌐 Which one stores a website’s files? (a) a code editor (b) a web server (c) a web browser
  22. 22.🔗 Which attribute holds the address of a link? (a) alt (b) src (c) id (d) href
  23. 23.🔠 Which heading shows the SMALLEST text: <h5>, <h3>, <h1> or <h4>? (a) <h5> (b) <h1> (c) <h4> (d) <h3>
  24. 24.Which of these is true of a code editor? (a) shows line numbers (b) shows pages from the web (c) sends pages over the net (d) opens web pages for us
  25. 25.True or false: <ul> is an empty tag. (a) True (b) False
  26. 26.🔡 Are HTML tag names usually written in small letters? (a) No (b) Yes
  27. 27.💬 How many paragraphs show on the page?
    <!-- <p>Cricket is fun.</p> -->
    <p>Rain today</p>
    <p>My pets</p>
    <p>Fun facts</p>
  28. 28.Which of these goes in the body? (a) <h1> (b) <title> (c) <meta charset="utf-8"> (d) <style>
  29. 29.🔗 Where does this link open?
    <a href="about.html">About us</a>
    (a) in the same tab (b) in a new tab
  30. 30.True or false: in <img>, src sets how wide it is. (a) False (b) True
  31. 31.🔗 Which address opens when you click this link?
    <a href="about.html">Take the quiz</a>
    (a) https://example.com (b) Take the quiz (c) about.html (d) contact.html
  32. 32.True or false: <ul> goes inside ul or ol. (a) True (b) False
  33. 33.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="tiger.jpg" alt="A tiger asleep" width="400">
    (a) A tiger asleep (b) width (c) tiger.jpg (d) A red kite
  34. 34.📋 Which tag goes around each item of a list? (a) <li> (b) <ol> (c) <p> (d) <ul>
  35. 35.🔗 Which address opens when you click this link?
    <a href="art.html">Art corner</a>
    (a) art.html (b) Art corner (c) quiz.html (d) news.html
  36. 36.True or false: <ol> shows bullet points. (a) False (b) True
  37. 37.🖼️ Which picture file does the browser load?
    <img src="tiger.jpg" alt="A tiger asleep" width="350">
    (a) kite.png (b) A tiger asleep (c) map.png (d) tiger.jpg
  38. 38.🔗 Which words do you click on?
    <a href="games.html">Visit the site</a>
    (a) href (b) Maths fun (c) Visit the site (d) games.html
  39. 39.True or false: <h1> goes in the body. (a) True (b) False
  40. 40.📋 How many items does this list show?
    <ul>
      <li>Jamun</li>
      <li>Banana</li>
      <li>Mango</li>
      <li>Orange</li>
    </ul>

Answer key

  1. False
  2. </h1>
  3. <!DOCTYPE html>
  4. <!--
  5. 4
  6. 4
  7. to leave notes
  8. element
  9. Space Facts
  10. Yes
  11. False
  12. in the same tab
  13. True
  14. <li>
  15. The red kite
  16. 3
  17. <b>
  18. </h1>
  19. </small>
  20. line 2
  21. a web server
  22. href
  23. <h5>
  24. shows line numbers
  25. False
  26. Yes
  27. 3
  28. <h1>
  29. in the same tab
  30. False
  31. about.html
  32. False
  33. A tiger asleep
  34. <li>
  35. art.html
  36. False
  37. tiger.jpg
  38. Visit the site
  39. True
  40. 4

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