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