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