1. Technology

How To Comment CSS


Young woman working with wireless technology
Aping Vision/STS/Photographer's Choice RF/Getty Images
When you add comments to your Cascading Style Sheets (CSS) you make it easier for other developers (or you in the future) to understand what you were trying to do with the CSS.
Difficulty: Easy
Time Required: 1 minute

Here's How:

  1. Add the first part of the CSS comment
  2. Write the text or information you want hidden
  3. Close the comment:


  1. Comments can span multiple lines.
  2. Comments can include CSS elements that you don't want in the document, but don't want to delete completely.
  3. Use comments whenever you write complicated CSS to add clarification.
  4. Comments can also include meta information like:
    • author
    • date created
    • copyright information

What You Need

  • CSS or Text editor

©2014 About.com. All rights reserved.