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