[WEB4LIB] Netscape 6 and .class in CSS > case sensitive

Thomas Dowling tdowling at ohiolink.edu
Wed Apr 5 17:20:32 EDT 2000


----- Original Message -----
From: "John Hubbard" <jhubbard at haverford.edu>
To: "Multiple recipients of list" <web4lib at webjunction.org>
Sent: Wednesday, April 05, 2000 3:53 PM
Subject: [WEB4LIB] Netscape 6 and .class in CSS > case sensitive


> Hello,
>
> http://www.haverford.edu/library/web/library2.html
> looks ok on IE5 and NS4, but the "class" notations for the style sheet
> aren't working in N6.
>
> Netscape 4 supports the "class" method for honing style sheets (cf.
> http://webreview.com/wr/pub/guides/style/mastergrid.html), is it
possible
> Moz5 has abandoned this feature?
>
> Answer: NoT eXacTLy (like XML, they're CaSe SENsItiVe!):
> http://www.haverford.edu/library/web/library.html
> shows the same page with a proper-case CSS.  So the moral of the story
seems
> to dictate a global "Change Case" on your W3C validated style sheet, as
> needed.




>From http://www.w3.org/TR/REC-CSS1 section 7.1:

"All CSS style sheets are case-insensitive, except for parts that are not
under the control of CSS. I.e., in CSS1, font family names and URLs can be
case-sensitive. Also, the case-sensitivity of the CLASS and ID attributes
is under the control of HTML."

And from http://www.w3.org/TR/REC-html40/intro/sgmltut.html section 3.2.2.

"Attribute values are generally case-insensitive. The definition of each
attribute in the reference manual indicates whether its value is
case-insensitive."

And, finally, from http://www.w3.org/TR/REC-html40/struct/global.html
section 7.5.2:

  Attribute definitions
    id = name [CS]
        This attribute assigns a name to an element.
        This name must be unique in a document.
    class = cdata-list [CS]
        This attribute assigns a class name or set of
        class names to an element...

Where the [CS] does in fact mean that class attribute values are case
sensitive.

I'll be dipped; I never realized this.  Note that HTML element names, in
both the HTML markup and the CSS stylesheet are case insensitive, as
opposed to XHTML.  So both "TD.foo" and "td.foo" will correctly set
properties for table data cells with a class attribute of "foo" (but not
"FOO" or "Foo"--at least, not in fully compliant browsers).


Thomas ("Fortunately, too lazy to hit the shift key that much") Dowling
OhioLINK - Ohio Library and Information Network
tdowling at ohiolink.edu




More information about the Web4lib mailing list