CSS Comments
CSS Comments
Comments help with documentation and are helpful for the future users who read that code, so that they can understand it easily.
Comments are ignored by the browser and Comments don't affect the styling or layout.
CSS Comments are enclosed between /* and */.
There are two types of comments in CSS:
Single-line comment:
Single-line comments are contained within one line. They are useful for short annotations.
Syntax
for example:
here, the comment is between /* and */
Multi-line comments
Multi-line comments span across multiple lines, making them ideal for detailed explanations or temporarily disabling blocks of code.
Syntax
These are similar to single-line comments, but this helps to comment large descriptions, notes, etc.
for example:
Tip: If you are using vs code, you can use `cltr + /` to comment the line.