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