← HTML comments lesson New set →

HTML Worksheet: Comments

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

Answer key

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

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