|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
CSS class identifiers
Does anyone know or know where to find naming rules for CSS class identifiers? This doesn't seem to be addressed in the W3 CSS documentation.
|
|
#2
|
|||
|
|||
|
It is -- you just need to know where to look.
The rules on naming classes, or any other selector that can take a "author-assigned" name, come under section 4 of the specs on CSS2 Syntax and basic data types ... in particular, in section 4.1.3. The most important bit of info there is: Quote:
In other words, it's best to stick with letters, numbers, and the hyphen. Unlike CSS2 keywords, property names, or pre-defined selector names (such as an HTML element selector like 'body' or 'BODY'), identifiers are case sensitive--so your use of case must remain consistent throughout your document(s). And although some browsers will let you get away with it, don't start a class name with a number (or a hyphen, for that matter). hth, bob
__________________
-- Bob Boyle boyleb@rappdigital.com www.rappdigital.com |
|
#3
|
|||
|
|||
|
Shouldn't that or the equivalent be in the CSS1 specs? Thanks alot Bob, exactly what I was looking for.
|
|
#4
|
|||
|
|||
|
According to Eric Meyer's CSS2 reference by Osbourne, yeah it should be. He doesn't have much to say about it other than the thing about numbers ... and he's wrong about it. He mentions that CSS1 prohibited starting with and number but that CSS2 allows it, but the text I quoted above states quite clearly that they still aren't allowed, whether browsers allow them or not.
shrug, bob |
|
#5
|
|||
|
|||
|
returning the favour (or something like that)
Check out URL
The guy there (Joe Burns) Has a lot of information and tudors on cascading style sheets, dynamic html, JavaScripting and all that stuff. The texts are easy reading, and all do he doesn't go extremly deep into subjects, if youre ad the end of the story, u should know pretty much everything about css, and all the stuff I mentioned. He teaches you the how to's and you wrap them up to superscripts yourself, check it out. (If you havent' already that is). (And i posted reply's to your suggetions on my thread) |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > CSS class identifiers |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|