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