[Home]Comment your stylesheet

HomePage | RecentChanges | Preferences | Newbie Help

Category CSS FAQ

Yes, you can. And it's useful, too. The [W3C] doesn't tell you why, but consider this short stylesheet here:

  h1 {
     font-size:2.5em;          /* marketing said headers have to be easy to read */
     color:lime;               /* favourite colour of CEO                        */
     background-color:pink;    /* favourite colour of Linda (secretary)          */

Without the comments, you'd probably forget why you used such an outrageous style; you'd replace it at once. But with the comments, everything makes sense: You're pleasing marketing, brown-nosing the management, and trying to impress the cute secretary, Linda.

I hope this small example has convinced you that comments are very important, both for your career and your love life!

Um, I thought that we all knew that Linda was in a committed, monogamous relationship with Angelique, who works at the espresso stand downstairs. I hope that you're not waiting for that to fall through. Etan Wexler
Styles which misbehave in an external stylesheet, but perform their jobs when the style sheet is included on the HTML page, is usually a sign that the author has some HTML mark-up in the style sheet, most typically HTML-style comment tags, instead of CSS-style comment tags.
Comments --
HomePage | RecentChanges | Preferences | Newbie Help
This page is read-only | View other revisions
Last edited September 5, 2002 5:07 pm (diff)

This FAQ is happily hosted by Betadome Digital Media