Tuesday, September 27, 2011

Is CSS case sensitive?

Cascading Style Sheets (CSS) is not case sensitve. However, font families, URLs to images, and other direct references with the style sheet may be.
If your page having an XML declaration and an XHTML DOCTYPE then the CSS selectors will be case-sensitive for some browsers, if your page having a HTML DOCTYPE then your CSS selectors will be case-insensitive.
It is a good idea to avoid naming classes where the only difference is the case, for example:
div.myclass { ...}
div.myClass { ... }

No comments:

Post a Comment