In HTML, how do I include a comment?
To incorporate comments (i.e., text that is not to be interpreted or displayed by the web browser) into your HTML source code, use the following format:
<!-- This sentence will not be displayed by the browser. -->
In an HTML comment, everything between the <!-- and
-->, including line breaks, is ignored by the web
browser. Here is a sample of commented HTML code:
The browser will interpret and display this as follows:
- Bob: 1234 Generic Drive, Erehwon, IN.
- Jane: 4321 Cireneg Avenue, Nowhere, MN.
- Joe: C/O Inmate 123456, Eslerehwyna Federal Penitentiary, Eslerehwyna, NY.
Note: You may not use the -- construct
inside an HTML comment. Also, some browsers interpret
> within a comment as the end of the
comment. Therefore, if you comment out HTML tags, some browsers may
not display your page correctly.
Last modified on September 28, 2007.







