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