HTML XHTML The Complete Reference
home » reference » appendix a » html element reference

<!-- ... --> (Comment)


This construct is used to include text comments that will not be displayed by the browser. No attributes or events are associated with this construct.

Standard Syntax


<!-- ... -->

Examples


<!-- This is an informational comment that can occur anywhere in an HTML document. The next examples shows how style sheets and scripts are "commented out" to prevent older browsers from misinterpreting the content. -->

<style type="text/css">
<!--
H1 {color: red; font-size: 40pt;}
-->
</style>

<script type="text/javascript">
<!--
document.write("hello world");
// -->
</script>

Compatibility


HTML 2, 3.2, 4, 4.01, XHTML 1.0, 1.1, Basic
Internet Explorer 2, 3, 4, 5, 5.5, 6
Netscape 1, 1.1, 2, 3, 4, 4.5-4.8, 6, 7
Opera 4-7

Notes


Comments often are used to exclude content from older browsers, particularly those that do not understand client-side scripting or style sheets. Page developers should be careful when commenting HTML markup. Older browsers may or may not render the enclosed content.

(X)HTML Elements
CSS Properties
Previous: colgroup Next: comments
< Home | About | Chapters | Examples | Errata | Reference | Site Map >