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