CSS TutorialLesson 5Free preview
CSS Comments
This lesson is part of CSS · All levels
Summary
CSS comments are written between /* and */ and will not be displayed or executed by the browser. Comments are useful for explaining a piece of code, temporarily disabling some style, or giving notes to a team. Comments may contain many lines and may be placed inside or outside the declaration block.
Key points
- The CSS comment syntax is /* comment text */.
- Comments never appear on the page render results.
- Multi-line comments are supported; any text in /* */ is safely ignored by the browser.
- Comment is often used to separate stylesheet sections, such as header or footer sections.
- Comments can be used to temporarily disable the rule without having to delete it.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.