Page is a not externally linkable
- Code, Content, and Presentation
-- CSS
---- Your Way Wanted: How do you comment in CSS and Why?


lexipixel - 12:55 am on May 19, 2007 (gmt 0)


I usually start out with a comment block like:

/* ============================================ */
/* domainname.css */
/* ============================================ */
/* Last Updated: 01/01/1980 */
/* ============================================ */
/* author: Alfred E. Newman, aen@mad.tld */
/* ============================================ */

Next, I leave myself some notes about colors in a comment block, like:

/* COLORS: */
/* BLACK rgb(0,0,0) #000000 */
/* WHITE rgb(255,255,255) #FFFFFF */
/* DK. GREY rgb(63,63,63) #3F3F3F */
/* MD. GREY rgb(127,127,127) #7F7F7F */
/* LT. GREY rgb(191,191,191) #6F6F6F */

I add comments ahead of sections where multiple classes and selectors are related, like:

/* ===================================== */
/* CSS for buttons in Top Navigation bar */
/* ===================================== */

..and at the end of the file I add one more block:

/* ===================================== */
/* EOF: domainname.css */
/* ===================================== */


Thread source:: http://www.webmasterworld.com/css/3343059.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com