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