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