← HTML comments lesson New set →

HTML Worksheet: Comments

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

Answer key

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

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