CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 31st, 2001, 10:36 AM
JMM JMM is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2001
Location: USA
Posts: 830 JMM User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 17 m 56 sec
Reputation Power: 13
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.

Reply With Quote
  #2  
Old August 31st, 2001, 11:53 AM
finelineBob finelineBob is offline
Senior Meddler
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Location: NY NY USA
Posts: 142 finelineBob User rank is Private First Class (20 - 50 Reputation Level)finelineBob User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
Send a message via AIM to finelineBob
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 CSS2, identifiers (including element names, classes, and IDs in selectors) can contain
only the characters [A-Za-z0-9] and ISO 10646 characters 161 and higher, plus the
hyphen (-); they cannot start with a hyphen or a digit. They can also contain escaped
characters and any ISO 10646 character as a numeric code (see next item). For instance,
the identifier "B&W?" may be written as "B\&W\?" or "B\26 W\3F".


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

Reply With Quote
  #3  
Old August 31st, 2001, 12:00 PM
JMM JMM is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2001
Location: USA
Posts: 830 JMM User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 17 m 56 sec
Reputation Power: 13
Shouldn't that or the equivalent be in the CSS1 specs? Thanks alot Bob, exactly what I was looking for.

Reply With Quote
  #4  
Old August 31st, 2001, 12:12 PM
finelineBob finelineBob is offline
Senior Meddler
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Location: NY NY USA
Posts: 142 finelineBob User rank is Private First Class (20 - 50 Reputation Level)finelineBob User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
Send a message via AIM to finelineBob
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

Reply With Quote
  #5  
Old September 2nd, 2001, 10:29 AM
Allrighty Allrighty is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2001
Location: Rotterdam, Netherlands
Posts: 1 Allrighty User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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)

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > CSS class identifiers

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap