Code commenting
There are many reasons you will need to use code commenting. For example, leaving a note for yourself, or a note for your collaborators.
Leaving a note for yourself is useful when you return to an old project that you might have forgotten how the code was structured. Leaving a note to your collaborators could be essential if you work on a team on the same project, and files. If you are creating a template, you will want to leave instructions for people, and showing people how to use your template, or which part of the code to alter.
Think of code commenting as an essential part of your workflow, not just a nice addition to it.
The syntax for commenting out text is different for HTML and CSS. For HTML
<!-- This is a comment. It is not displayed in the browser -->
A comment starts with a left angle bracket followed by an exclamation point and 2 dashes. The commented text comes after that, and is then followed by 2 dashes and a right angle bracket. Anything that is within the comment tag is not visible in the browser. This is very helpful when you wish to hide a portion of your page while in development.
For CSS
/* comment goes here */
As with HTML, the comments can be used to either explain something or "comment out" some of the CSS.
Leaving a note for yourself is useful when you return to an old project that you might have forgotten how the code was structured. Leaving a note to your collaborators could be essential if you work on a team on the same project, and files. If you are creating a template, you will want to leave instructions for people, and showing people how to use your template, or which part of the code to alter.
Think of code commenting as an essential part of your workflow, not just a nice addition to it.
The syntax for commenting out text is different for HTML and CSS. For HTML
<!-- This is a comment. It is not displayed in the browser -->
A comment starts with a left angle bracket followed by an exclamation point and 2 dashes. The commented text comes after that, and is then followed by 2 dashes and a right angle bracket. Anything that is within the comment tag is not visible in the browser. This is very helpful when you wish to hide a portion of your page while in development.
For CSS
/* comment goes here */
As with HTML, the comments can be used to either explain something or "comment out" some of the CSS.