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