HTML Comments

Another important piece of markup that you'll want to get started using right away is HTML comments. Comments enable you to hide content or markup for temporary purposes or backward compatibility, to identify sections within your document, and to provide directives for other folks who might be working on the page.

The syntax for an HTML comment looks like this:

<!-- -->

What you are hiding, identifying, or providing in terms of guidance goes between the opening and closing portions of a comment. Example 1-13 hides the text content within the body using comments.

Example 1-13. Hiding text content and markup

<body><!--<p>The content of this paragraph will not appear within the body so long as it's within a comment.</p>--><p>The content of this paragraph will be displayed, because it's outside of the  ...

Get Spring Into HTML and CSS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.