← HTML comments lesson New set →

HTML Worksheet: Comments

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

Answer key

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

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