← HTML comments lesson New set →

HTML Worksheet: Comments

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

Answer key

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

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