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