← HTML comments lesson New set →

HTML Worksheet: Comments

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

Answer key

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

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