[thelist] your opinion solicited on coding specs I requested from contractor

Sam-I-Am sam at sam-i-am.com
Mon Oct 22 10:50:18 CDT 2001

actually I disagree

> 2. Specify that they must use classes that are a description of the style, not
> what the style is used for. For example, instead of using <span
> class="Intro_title">Hello world!</span> They should put <strong
> class="large_bold">Hello world!</strong>. 

the class name, like the markup, should be logical rather than physical.
My pet peeve is classes like .smallred { } .. when I come back to
implement a redesign I'm left with a load of non-sensical classnames. I
would rather it be .note {} or .errorMsg {}, or something that tells me
what the style is for, and not include presentation specifics. 

True, this may come at the price of some repetition in the stylesheet..
but that's why we have comma delimited selectors (.note, .errorMsg {
font-size: small } )

Similarly, don't uses classes when you really need IDs. If you are
trying to distinguish unique page areas, name them logically and refer
to them by ID
e.g #primaryHeading {}


More information about the thelist mailing list