basics of website design banner photo

HTML

HTML 5

CSS 2.1

CSS 3

Reference

HTML <comment> Element

The comment element is primarily used to contain information which is used as a reference by the designer. Whatever is contained between the opening and closing comment tags is ignored by the browser and not displayed in the page content.

HTML comments

HTML comments start with "<!--" and close with "-->" and the text of the comment is written between these two tags.
Example:

<!--This text is a comment-->

Adding comments to code makes the initial design more time consuming but the benefits far outweigh this small inconvenience. Coming back to code that you haven't looked at for months or even years is made far easier if comments are used to explain complex code and the meaning of variables or attributes.
Additionally, if a different designer needs to understand or alter the website, well commented code can greatly speed up the process.

The <comment> element doesn't support any attributes.

CSS comments

CSS comments start with "/*" and close with "*/" and the text of the comment is written between these two expressions.
Example:

/*This text is a comment*/

Attributes

NONE

HTML 4 Element List