Skip to main content

Adding Comments

If you are involved in writing a Web page of a reasonable size then it might be useful to annotate the X/HTML code so that you are reminded as to what section of the code does what. Text inserted as a "comment" is not displayed on the viewing screen and is only visible when the source code of the Web page is viewed.

To add a comment to the X/HTML code we use the following X/HTML tags:

Should appear at the beginning of any comment
Should appear after the comment.

For example:

<!-- The following shows the use of the header tag -->
<h3>Example Header</h3>
<!-- The following shows the use of the paragraph  tag -->
<p>This is a small paragraph.</p>