Showing posts with label CSS. Show all posts
Showing posts with label CSS. Show all posts

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 { ... }

Monday, September 26, 2011

Safari CSS Hack code

I tried to fix safari CSS issue. I found one code,

body { margin-top: 15px; }
/* Safari Hack CSS */
@media screen and (-webkit-min-device-pixel-ratio:0) {body { margin-top: 10px; }}

This will affect the CSS style for only safari browsers.