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