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