← HTML comments lesson New set →

HTML Worksheet: Comments

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

Answer key

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

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