Forum Moderators: open

Message Too Old, No Replies

always lower-case?

         

Makaveli2007

6:37 pm on Nov 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Should I always use lower-case letters when typing html (4.01 strict) or CSS code?

I thought I should do it, but it seems that for CSS sometimes people (including those who create html tutorials) use "Times New Roman" etc. instead of "times new roman".

encyclo

6:52 pm on Nov 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



1. HTML is case-insensitive.

2. XHTML is case-sensitive, lower-case only.

3. CSS is case-insensitive... but font-family declarations, URLs (eg. links to background images) may be case-sensitive. (In both situations, the case-sensitivity is not directly related to the CSS.)

What's more,

id
and
class
names are also case-sensitive, so
.myClass
is not the same as
.myclass
- so it is important to always remain consistent, and many people prefer using lower-case only to avoid problems.

References:
[devedge-temp.mozilla.org...]
[w3.org...]
[dbaron.org...]

Makaveli2007

10:42 pm on Nov 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thanks. I guess Ill stick to lower-case only for now.