Zvona
12-28-2002, 10:56 AM
This isn't truly a problem, more like a simple question where I couldn't find a proper answer.
Because XHTML said to be case-sensitive and all the elements and attributes are needed to type lowercase, is this invalid css :
.
<style type="text/css">
BODY {background-color:#FFFFF8;color:#000000;}
P {border:1px solid #C0C0C8;}
</style>
.
.
<body>
<p>Foo, bar...</p>
</body>
.
.
In other words : is it mandatory to define css selectors in lowercase or are they valid also in uppercase?
krycek
12-28-2002, 12:43 PM
AFAIK you should use lowercase. At least, that's what my interpretation of the standards lead me to believe :)
::] krycek [::
BrainJar
12-28-2002, 05:54 PM
According to the CSS2 spec (http://www.w3.org/TR/CSS21/selector.html#q1):
The case-sensitivity of document language element names in selectors depends on the document language. For example, in HTML, element names are case-insensitive, but in XML they are case-sensitive.
So for XHTML, that would technically be invalid CSS. But some browsers may not care. For HTML, it shouldn't matter.
Alex Vincent
12-30-2002, 11:45 PM
More accurately, when you serve it as text/html, it shouldn't matter.
MrDoubtFire
01-06-2003, 05:22 PM
You'd -think- that the browser coders would add a line to transform everything to lowercase before applying css styles etc., But that would just be -too- difficult I guess.... (tongue in cheek)
So, what do they do? Ahh yes they make -us- do all the work rather than making life easy for us! How silly of me to expect so much! LOL
MrDoubtFire
Originally posted by MrDoubtFire
You'd -think- that the browser coders would add a line to transform everything to lowercase before applying css styles etc., But that would just be -too- difficult I guess.... (tongue in cheek)
So, what do they do? Ahh yes they make -us- do all the work rather than making life easy for us! How silly of me to expect so much! LOL
MrDoubtFire
Umm, did you read what Alex Vincent just wrote? XML is case-sensitive, therefore:
<mytag> and <myTag> are very different elements. If a browser converted all element names to lower case, then it would be wrecking XML.
And how is writing:
div { }
Anymore work than writing DIV {} ?
I don't see your complaint, even if it was well-founded.