Date: Thu, 20 Jun 2013 02:24:20 +0200
Quote:
- CSS Insider
Conditional CSS - not just for IE
http://css.weblogsinc.com/2006/07/24/conditional-css-not-just-for-ie/
Text:
- It's true that IE is the most notorious browser for inconsistencies, incompatibilities, and bugs. But the fact remains that no two browsers are created equal, and while IE is the most likely to cause headaches in the course of development, other browsers can be culprits, as well.
If you run into a major roadblock, Rafael Lima's CSS Browser Selector could be your saving grace. A tiny bit of Javascript (less than 1kb!) determines the user's browser and creates an accordingly-named class. From there, it's simply a matter of applying the styles that were written for that particular browser. For example:
.ie .example {
background-color: yellow
}
.gecko .example {
background-color: gray
}
.opera .example {
background-color: green
}
.konqueror .example {
background-color: blue
}
.webkit .example {
background-color: black
}
.example {
width: 100px;
height: 100px;
background-color: brown;
} The colored box on the CSS Browser Selector page gets the point across better than anything else, though. Open the page in a few different browsers to see for yourself.
Read | Permalink | Email this | Linking Blogs | Comments
Via FeedShow.com