Nice little blog entry you have there Mike, I like the honesty you've
conveyed in your opinions (and the little graphic ".right .wrong" made
me giggle too!) :)
From my own perspective (as incorrect or unpopular as it may be) I
think you're almost there with what I would call "useful and flexible
identifiers". For CSS identifiers, I try (but not always succeed
admittedly) to meet both the "useful" and "flexible" requirements.
Class names such as .blue, .bold, .leftNav etc are useful (tick) but not
really flexible (from my previous post about changing the look etc).
Class name such as .col1, .col2 etc are "flexible" (tick) but they're
not really useful... what is this .col1? what's in it? does it have a
particular purpose? These are questions that cant be answered by the
identifier. Its kinda like a php variable being called $myvar (what on
earth is this thing?).
A few people have pointed out that they use the .leftNav etc because
they are more useful to their clients and I would agree that .leftNav is
far more obvious than .col1. However, those names are only useful until
the site needs a redesign/restructure (actually 3 months later we've
decided that our users would prefer the navigation on the left to be a
horizontal nav under the banner... eeek, that .leftNav isn't looking so
obvious now!).
Personally I would look at the elements and determine what their
function is before deciding on what identifier to give it. The left nav
may be a the location of the main navigation, so #main_nav might be a
more suitable choice (and its still obvious what it is), and that right
nav may hold ancillary links and info such as external links, recent
blog entries etc, so #support_info might be another choice (I also
prefer to use id identifiers over classes for elements I know are unique
to a page.
All in all though, a nice honest account of your opinions on (what I
feel) is actually a very important topic with web standards (raise
you're hand if you've used a freelancer and have looked through their
html code and thought "what the hell does that class name mean?" :)
Thanks,
David.
Mike at Green-Beast.com wrote:
Hello Group,
For about a week I had a draft started on my blog. In answering Designer's
question about p:first-line a can of worms was opened up. I'm grateful
because it showed me a side of a topic I hadn't really considered previously
and was I prepared to simply write about the subject of Class & ID Naming
Conventions from my perspective only. Being that we had this discussion my
eyes were opened to another side. Thus I was able to write a hopefully more
objective, well-rounded article.
I doubt everyone will fully agree (that would impossible) or disagree (and
hopefully that's impossible too), but I attempted to cover the topic in a
decent way without going too far in either direction. I try to find middle
ground in everything, and to this subject, hopefully that's where I landed.
http://green-beast.com/blog/?p=117
Respectfully,
Mike Cherim
http://green-beast.com/
*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************
*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************
__________ NOD32 1.1742 (20060906) Information __________
This message was checked by NOD32 antivirus system.
http://www.eset.com
*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************