← HTML comments lesson New set →

HTML Worksheet: Comments

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

Answer key

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

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