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