CKTIS / HTML
HTML comments
An HTML comment uses `<!-- ... -->` to record notes in source code. Its contents are not displayed as page text. Comments cannot be nested, and their contents must obey specific syntax restrictions.
Version: WHATWG HTML Living Standard; index snapshot date recorded separately
Syntax
<!-- ... -->In <!-- ... -->, <!-- opens the comment and --> closes it; ... is a placeholder for its contents. The contents may be empty or span multiple lines. Place comments between elements or within their contents where allowed, not inside a start tag.
The contents must not start with > or ->, contain <!--, -->, or --!>, or end with <!-. Consequently, comments cannot be nested. The sequence -- alone is not forbidden by these HTML syntax rules.
A comment does not remove information from the file: it remains accessible in the source, so do not store secrets in it. In the example, the visible page text is Hello!, while the note remains in the source.
Examples
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Comment example</title>
</head>
<body>
<!-- This note is not displayed. -->
<p>Hello!</p>
</body>
</html>Result
Hello!
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.