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