Framify

Tag: <!-- ... -->

<!-- ... --> Syntax

Syntax Diagram for <!-- ... -->
Opening Tag Content Closing Tag
<!-- text -->
Alternate form:
<! text >

<!-- ... --> Description

The <!-- ... --> tag allows you to put comments into your HTML file; whatever appears in the source file between the "<!--" and the "-->" will still be downloaded to the browser and will still be visible in a View Source window, but it will not be displayed in the normal HTML fashion.

Comments are typically used to include information about the author, copyright restrictions, etc., into the file being browsed. Comments are also used during debugging phase of HTML page creation to temporarily disable certain parts of the page while concentrating on another part, and for "hiding" JavaScript code from the text-interpreting mechanism of the browser (see <script>).


Note: HTML comments are not nestable; that is, you cannot have comments inside comments. Thus, you cannot disable a portion of an HTML-tagged page with a comment if that portion of the page contains other comments; the first end-comment tag will terminate the current comment, no matter how many times it has been "started" (see example below).

HTML comments require a start tag and an end tag, unlike JavaScript comments (//), which extend only to the end of the current line.

<!-- ... --> Example

This markup: Here is a <!-- comment one --> section of an HT<!-- comment two; this one is a little bit longer -->ML-tagged page. <p> Here is a fruitless attempt at a nested comment: <!-- Here is a <!-- comment one --> section of an HT<!-- comment two; this one is a little bit longer -->ML-tagged page.--> <p> Here is a <! comment one > section of an HT<! comment two; this one is a little bit longer >ML-tagged page. <p> Here is a fruitless attempt at a nested comment: <! Here is a <! comment one > section of an HT<! comment two; this one is a little bit longer >ML-tagged page.> . . .causes the following to be displayed:
Here is a section of an HTML-tagged page.

Here is a fruitless attempt at a nested comment: section of an HTML-tagged page.-->

Here is a section of an HTML-tagged page.

Here is a fruitless attempt at a nested comment: section of an HTML-tagged page.>


Last Modified: