[thelist] CSS-P tip
Aylard JA (James)
jaylard at equilon.com
Tue May 9 16:49:34 2000
John Corry wrote:
> OK, I've been trying for the last hour to get my <divs> to line up in NN
> 4.5. They finally are taking the positioning attributes from their
> respective classes in the style tag. Guess what I changed...the class
names
> (of all ludicrous things) from .1, .2, and .3 to .a, .b, and .c
Actually, this is one of those relatively rare instances in which
Netscape 4.x actually implements the CSS spec correctly. According to the
W3C, the first character of a class or id value must be an alpha character,
not numeric:
"in CSS1, selectors (element names, classes and IDs) can contain only the
characters A-Z, 0-9, and Unicode characters 161-255, plus dash (-); they
cannot start with a dash or a digit; they can also contain escaped
characters and any Unicode character as a numeric code (see next item)."
You will find that IE will allow classes and ids to begin with
numeric characters, but you should avoid using them anyway. That way, your
style sheets will be legal and cross-browser compatible.
James Aylard
jaylard@equilon.com