← HTML comments lesson New set →

HTML Worksheet: Comments

HTML and CSS lesson 9: HTML comments · Set 402 · 40 questions
TalentJR

Code tip (Hidden notes): A comment is <!-- note -->: it starts with <!-- and ends with -->. Anything inside a comment, even a whole <p>, is not shown. Comments can be read with “view source” — never put secrets in them.

NameDateTime takenScore ___ / 40
  1. 1.💬 Why do coders write comments? (a) to leave notes (b) to show pictures (c) to add colour (d) to make links
  2. 2.💬 Which text will NOT show on the page?
    <p>My pets</p>
    <!-- <p>Good morning!</p> -->
    <p>My best friend</p>
    (a) Good morning! (b) My best friend (c) My pets
  3. 3.💬 How many paragraphs show on the page?
    <p>Our school trip</p>
    <p>Hello, world!</p>
    <!-- <p>Rain today</p> -->
    <p>The red kite</p>
  4. 4.💬 Which text will NOT show on the page?
    <p>Cricket is fun.</p>
    <!-- <p>My pets</p> -->
    <p>Rain today</p>
    <p>Fun facts</p>
    (a) Fun facts (b) Rain today (c) My pets (d) Cricket is fun.
  5. 5.💬 How many paragraphs show on the page?
    <!-- <p>Good morning!</p> -->
    <p>My best friend</p>
    <!-- <p>Hello, world!</p> -->
  6. 6.💬 How does an HTML comment end? (a) >> (b) --> (c) // (d) */
  7. 7.💬 How many paragraphs show on the page?
    <p>My best friend</p>
    <!-- <p>Rain today</p> -->
    <!-- <p>My pets</p> -->
  8. 8.💬 Does the browser show comments on the page? (a) Yes (b) No
  9. 9.💬 How does an HTML comment start? (a) // (b) /* (c) # (d) <!--
  10. 10.💬 Which text will NOT show on the page?
    <!-- <p>My pets</p> -->
    <p>Rain today</p>
    <p>Cricket is fun.</p>
    <p>The red kite</p>
    (a) The red kite (b) My pets (c) Cricket is fun. (d) Rain today
  11. 11.💬 Which text will NOT show on the page?
    <!-- <p>The red kite</p> -->
    <p>Hello, world!</p>
    <p>Cricket is fun.</p>
    <p>My pets</p>
    (a) My pets (b) Hello, world! (c) The red kite (d) Cricket is fun.
  12. 12.💬 How many paragraphs show on the page?
    <!-- <p>Hello, world!</p> -->
    <p>I love mangoes.</p>
    <!-- <p>Fun facts</p> -->
  13. 13.💬 How many paragraphs show on the page?
    <!-- <p>Rain today</p> -->
    <!-- <p>My best friend</p> -->
    <p>Good morning!</p>
    <!-- <p>I love mangoes.</p> -->
    <!-- <p>Hello, world!</p> -->
  14. 14.💬 Which text will NOT show on the page?
    <p>My pets</p>
    <p>The red kite</p>
    <!-- <p>Good morning!</p> -->
    (a) My pets (b) The red kite (c) Good morning!
  15. 15.💬 How many paragraphs show on the page?
    <!-- <p>My pets</p> -->
    <p>The red kite</p>
    <!-- <p>Fun facts</p> -->
    <p>I love mangoes.</p>
  16. 16.💬 How many paragraphs show on the page?
    <!-- <p>Our school trip</p> -->
    <!-- <p>Good morning!</p> -->
    <!-- <p>Fun facts</p> -->
    <!-- <p>Cricket is fun.</p> -->
    <p>Rain today</p>
  17. 17.💬 How many paragraphs show on the page?
    <!-- <p>Hello, world!</p> -->
    <p>Good morning!</p>
    <p>Our school trip</p>
    <!-- <p>My pets</p> -->
  18. 18.💬 Which text will NOT show on the page?
    <p>Rain today</p>
    <p>I love mangoes.</p>
    <!-- <p>My best friend</p> -->
    (a) My best friend (b) I love mangoes. (c) Rain today
  19. 19.💬 How many paragraphs show on the page?
    <p>My best friend</p>
    <!-- <p>Hello, world!</p> -->
    <p>Our school trip</p>
    <!-- <p>Rain today</p> -->
    <p>Cricket is fun.</p>
  20. 20.💬 Can anyone read your comments by viewing the page source? (a) No (b) Yes
  21. 21.💬 Which text will NOT show on the page?
    <!-- <p>Our school trip</p> -->
    <p>I love mangoes.</p>
    <p>Hello, world!</p>
    <p>Rain today</p>
    (a) Our school trip (b) I love mangoes. (c) Rain today (d) Hello, world!
  22. 22.💬 How many paragraphs show on the page?
    <!-- <p>My pets</p> -->
    <!-- <p>Cricket is fun.</p> -->
    <p>My best friend</p>
    <!-- <p>I love mangoes.</p> -->
    <!-- <p>Hello, world!</p> -->
  23. 23.💬 How many paragraphs show on the page?
    <p>My pets</p>
    <!-- <p>My best friend</p> -->
    <p>Our school trip</p>
    <p>Hello, world!</p>
  24. 24.💬 Which text will NOT show on the page?
    <p>The red kite</p>
    <p>Good morning!</p>
    <p>My pets</p>
    <!-- <p>Fun facts</p> -->
    (a) My pets (b) The red kite (c) Fun facts (d) Good morning!
  25. 25.💬 How many paragraphs show on the page?
    <!-- <p>I love mangoes.</p> -->
    <p>Good morning!</p>
    <!-- <p>Cricket is fun.</p> -->
    <!-- <p>My pets</p> -->
    <!-- <p>Fun facts</p> -->
  26. 26.💬 Which text will NOT show on the page?
    <p>Rain today</p>
    <p>Our school trip</p>
    <!-- <p>Hello, world!</p> -->
    <p>I love mangoes.</p>
    (a) I love mangoes. (b) Our school trip (c) Hello, world! (d) Rain today
  27. 27.💬 Which text will NOT show on the page?
    <p>Rain today</p>
    <p>I love mangoes.</p>
    <!-- <p>My pets</p> -->
    <p>My best friend</p>
    (a) My best friend (b) My pets (c) Rain today (d) I love mangoes.
  28. 28.💬 Which text will NOT show on the page?
    <p>Good morning!</p>
    <p>The red kite</p>
    <!-- <p>Rain today</p> -->
    (a) Good morning! (b) Rain today (c) The red kite
  29. 29.💬 How many paragraphs show on the page?
    <p>Hello, world!</p>
    <p>My pets</p>
    <p>Our school trip</p>
    <p>Fun facts</p>
    <!-- <p>I love mangoes.</p> -->
  30. 30.💬 How many paragraphs show on the page?
    <p>My best friend</p>
    <!-- <p>Our school trip</p> -->
    <p>Hello, world!</p>
    <p>My pets</p>
  31. 31.💬 Which text will NOT show on the page?
    <p>I love mangoes.</p>
    <!-- <p>Hello, world!</p> -->
    <p>My best friend</p>
    <p>Cricket is fun.</p>
    (a) I love mangoes. (b) My best friend (c) Cricket is fun. (d) Hello, world!
  32. 32.💬 How many paragraphs show on the page?
    <p>The red kite</p>
    <!-- <p>I love mangoes.</p> -->
    <!-- <p>My pets</p> -->
  33. 33.💬 Which text will NOT show on the page?
    <p>Fun facts</p>
    <p>I love mangoes.</p>
    <!-- <p>Rain today</p> -->
    (a) I love mangoes. (b) Fun facts (c) Rain today
  34. 34.💬 Which text will NOT show on the page?
    <!-- <p>My pets</p> -->
    <p>Our school trip</p>
    <p>Good morning!</p>
    (a) Our school trip (b) Good morning! (c) My pets
  35. 35.💬 Which text will NOT show on the page?
    <!-- <p>My pets</p> -->
    <p>Rain today</p>
    <p>Hello, world!</p>
    (a) Hello, world! (b) Rain today (c) My pets
  36. 36.💬 Which text will NOT show on the page?
    <p>Our school trip</p>
    <p>Rain today</p>
    <!-- <p>The red kite</p> -->
    (a) Our school trip (b) The red kite (c) Rain today
  37. 37.💬 How many paragraphs show on the page?
    <p>My pets</p>
    <p>Hello, world!</p>
    <!-- <p>The red kite</p> -->
    <p>Good morning!</p>
  38. 38.💬 How many paragraphs show on the page?
    <p>My pets</p>
    <p>Cricket is fun.</p>
    <!-- <p>Rain today</p> -->
    <p>My best friend</p>
    <!-- <p>Hello, world!</p> -->
  39. 39.💬 How many paragraphs show on the page?
    <p>Fun facts</p>
    <p>Our school trip</p>
    <p>I love mangoes.</p>
    <!-- <p>My pets</p> -->
    <p>My best friend</p>
  40. 40.💬 How many paragraphs show on the page?
    <!-- <p>Rain today</p> -->
    <p>My pets</p>
    <p>The red kite</p>
    <p>My best friend</p>

Answer key

  1. to leave notes
  2. Good morning!
  3. 3
  4. My pets
  5. 1
  6. -->
  7. 1
  8. No
  9. <!--
  10. My pets
  11. The red kite
  12. 1
  13. 1
  14. Good morning!
  15. 2
  16. 1
  17. 2
  18. My best friend
  19. 3
  20. Yes
  21. Our school trip
  22. 1
  23. 3
  24. Fun facts
  25. 1
  26. Hello, world!
  27. My pets
  28. Rain today
  29. 4
  30. 3
  31. Hello, world!
  32. 1
  33. Rain today
  34. My pets
  35. My pets
  36. The red kite
  37. 3
  38. 3
  39. 4
  40. 3

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