Case sensitivity of class and id

CSS2 section 4.1.3 says:

All CSS style sheets are case-insensitive, except for parts that are not under the control of CSS. For example, the case-sensitivity of values of the HTML attributes "id" and "class", of font names, and of URIs lies outside the scope of this specification. Note in particular that element names are case-insensitive in HTML, but case-sensitive in XML.

This case sensitivity is noted in HTML 4.0. Id and class are described in section 7.5.2, which says they are case sensitive.

This paragraph should be blue.

This paragraph should be black.

This paragraph should be black.

This paragraph should be black.

This paragraph should be black.

This paragraph should be green.

This paragraph should be black.

This paragraph should be black.

This paragraph should be black.

This paragraph should be black.

This paragraph should be fuchsia.

This paragraph should be black.

This paragraph should be black.

This paragraph should be black.

This paragraph should be black.

This paragraph should be aqua.

This paragraph should be navy.

This paragraph should be black.

This paragraph should be black.

This paragraph should be black.

This paragraph should be black.

This paragraph should be maroon.

This paragraph should be purple.

This paragraph should be black.

This paragraph should be black.

This paragraph should be black.

This paragraph should be black.

This paragraph should be gray.


Valid HTML 4.0!

(Back to CSS Testing Information, David Baron)

LDB, dbaron@dbaron.org