BestWebTutorials.com
A service of CrystalClearWeb.net
 
Web BestWebTutorials.com

XHTML - <!-- ... --> Comment Tag

Definition

The <!-- --> tag pair defines a comment element. Any text within the comment tags will be sent to the client browser, but will not be displayed on the page. The comment text is visible to the user if they view the source of the document.

Comments are used for a variety of purposes. It is a good practice to use comments in your XHTML code to delineate sections of code, or to place comments to make maintenance of the code easier at a later date.

Another common use of comments is to isolate code within a script such as javascript to hide it from older browsers that cannot properly evaluate the script. This is becoming less of an issue every day as older browsers fall out of use.

Example

<p>This is a paragraph before a comment</p>
<!-- This is a comment, it will not display on the page -->
<p>This is a paragraph after the comment</p>

Output

This is a paragraph before a comment

This is a paragraph after the comment

Attributes

None

Events

None

Return to XHTML Tags List

BestWebTutorials.com is a free service of CrystalClearWeb.net. You can help us keep providing free tutorials and information by:

  • Link to us
  • Tell a friend
  • Correct any  you might find
  • Make for improvement
  • Make a donation


web services byCrystalClearWeb.net