← HTML comments lesson New set →

HTML Worksheet: Comments

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

Answer key

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

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