tags:

views:

39

answers:

2

4.2. Element and attribute names must be in lower case

XHTML documents must use lower case for all HTML element and attribute names. This difference is necessary because XML is case-sensitive e.g. <li> and <LI> are different tags.

Source : http://www.w3.org/TR/2002/REC-xhtml1-20020801/diffs.html#h-4.2

But is it also necesary for attributes properties values, calss and ID for elements.

Upper case and came case should not be used.

What is the benefit of use lowercase for every thing?

+2  A: 

What is the benefit of use lowercase for every thing?

There are a few good reasons:

  • simplifies implementation; you'll only have to look for one variant to match a tag, not all its case-sensitive variants, for example
  • easier to type, if needed; humans appreciate things that save them effort
  • one consistent way to do everything
  • lower cognitive overhead about whether this tag should be capitalized or not
John Feminella
+2  A: 

The only real benefit is that your webpage will be XHTML compliant. Browsers are built on the philosophy of "Be conservative in what you emit and liberal in what you accept", and doing crazy capitalization things should not throw any of them (except maybe IE, but that's a whole other battle)

As for theoretical benefits, it saves time/effort for developers, but AFAIK, browsers don't care, so...

waiwai933
+1 for being critical of IE
George Edison