Lee Powell wrote: > I'm working on a new project, and I'm keen to get my naming > conventions down to convey meaning in what I'm marking up.
Then you need to consider the meaning (semantics) of elements, as opposite to how you might style them. A good rule of thumb is that class names should make sense even if the visual rendering is completely changed or if non-visual styling (aural style sheets) is considered. > Anyway, design have produced a layout which makes use of the normal > elements along with 2 rather odd block style buttons, there's nothing > unique about them, except they are normal anchors with a bit of > padding. One style has a black background and the other grey, both > with white text. You're not saying anything about the meaning, so how could we know what might be appropriate meaning-based names? > So my markup looks like this: > > <span class="button"><a href="...">This is a button</a></span> I wonder if you really need that <span>. Can't you just assign a class to the <a> element? But "button" isn't really semantic. It's impossible to make any suggestions on naming without knowing the semantics - unless you decide to use rendering-oriented names, in which case "black" and "grey" would probably be suitable. > So I need a naming convention to differentiate between the two, and I > really don't want to use 'black' and 'grey' for obvious reasons, Which obvious reasons? > 'style-a' and 'style-b' doesn't seem to convey much meaning... Neither do "button", "black", and "grey". They all relate to rendering. Do you mean they aren't _mnemonic_. If you want to be _explicit_ about rendering intentions, you can use class="black button" class="grey button" i.e. use class attributes with two classes. Beware that some old browsers don't support this, and new browsers may have bugs related to multiple classing. Or you might use "black_button" and "grey_button". I don't really see the problem, if you are worried about being _mnemonic_. Just spell things out. Jukka K. Korpela ("Yucca") http://www.cs.tut.fi/~jkorpela/ ______________________________________________________________________ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/