Log in

View Full Version : CSS - should it be written as all lowercase?



Skinnybobb
07-30-2009, 12:06 PM
Hi,
I'm currently in an argument with a developer.

I say that all css should be written lower case - in the css file and when referenced in the html.

He says that it can have upper cases in it so it reads more easily.

E.g.

<class="tablemargin"> or
<class="TableMargin">

Who is right? If anyone?
Mark

boogyman
07-31-2009, 01:23 AM
<class="tablemargin"> or
<class="TableMargin">


CSS is case-sensitive, therefore both of your examples are correct; They are just two different references.



<style type="text/css">
element.tablemargin {/* lowercase styles */}

element.TableMargin {/* Firstcase styles */}
</style>

<element class="tablemargin"> ... </element>

<element class="TableMargin"> ... </element>

chynna16
08-02-2009, 05:31 AM
Not only CSS class should be case sensitive!

Though i have not tried as you have said, but according to me class name can be differentiated with upper and lower case.

I think this should help you

Good Day