1. Home
  2. Computing & Technology
  3. Web Design / HTML

How To Comment CSS

By , About.com Guide

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:
    */
Tips:
  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
Explore Web Design / HTML
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Web Design / HTML

©2009 About.com, a part of The New York Times Company.

All rights reserved.