tee g.peng wrote:
I remember reading an interesting thread about using lowercase for CSS element naming, but I can't seemed to find that thread from mail-archive. Vaguely I remember it was something about xml wellformness - before reading that thread, I used to use lower uppercase names, and thought it was just one's preferences.
Case sensitivity of selectors is dependent upon the markup language. For HTML, where element names are case insensitive, type selectors are also case insensitive. IDs and classes are case sensitive in HTML, and so they are case sensitive when referred to by selectors.
eg. uppercase DIV, H1, P are equivalent to lowercase div, h1, p, respectively. But #FOO is different from #foo and .FOO is different from .foo
In XML (and XHTML), where everything is case sensitive, selectors are too. Thus uppercase DIV, H1, P would be different from lowercase div, h1 and p.
Personally, I like to use all lowercase all lowercase type selectors because then the same stylesheet can be used for both XHTML and HTML versions. I use hyphen-separated-words for IDs and classes, because it matches the convention used for CSS properties.
e.g. <p id="some-id" class="some-class"> p#some-id.some-class -- Lachlan Hunt http://lachy.id.au/ ****************************************************** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list & getting help ******************************************************
