CSS Comments

The syntax for CSS Comments is very similar to that of other programming and scripting languages like PHP and JavaScript.

Unlike PHP and JavaScript though, CSS comments can only be used one way.

Begin your comment with a /*, and end it with */. As an example:
/* Hey, this is a comment */

The comment block can span multiple lines:
/*
Howdy there,
partner
*/

How you lay your comments out is down to personal preference. I usually do the following:
/*
* This is my multi-lined
* comment. I have all
* asterixes lines up with
* two spaces after before
* starting the text.
*/

It make it much easier to pick out comments away from large chunks of code this way.

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • email
  • FriendFeed
  • LinkedIn
  • Live
  • MSN Reporter
  • MySpace
  • PDF
  • Ping.fm
  • Posterous
  • Reddit
  • RSS
  • Slashdot
  • StumbleUpon
  • Suggest to Techmeme via Twitter
  • Technorati
  • Tumblr
  • Twitter
  • Yahoo! Bookmarks
  • Yahoo! Buzz
This entry was posted on Thursday, January 14th, 2010 at 10:23 pm and is filed under CSS Tutorials. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Post a Comment