← Back to Index

CSS Comments

CSS comments are notes that you can add to your stylesheets to explain your code. They are ignored by browsers and won't affect how your styles are rendered.

Single-line Comments

Single-line comments start with /* and end with */. They can be used for short explanations.

/* This is a single-line comment */ .example { color: blue; }

Multi-line Comments

Multi-line comments also use /* and */, but can span multiple lines. They're useful for longer explanations or temporarily disabling large blocks of CSS.

/* This is a multi-line comment It can span across several lines Very useful for detailed explanations */ .example { color: blue; padding: 10px; }

Best Practices

Interactive Example

Hover over this section to see a subtle animation effect!

/* Hover effect styles */ .interactive-demo:hover { transform: scale(1.01); transition: transform 0.3s ease; }