← HTML comments lesson New set →

HTML Worksheet: Comments

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

Answer key

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

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