http://www.conditional-css.com/usage
Introduction
Undoubtedly every web-designer and developer who as made any attempt to use CSS will have found a situation where different web-browsers require different style statements. This irritation is due to the varying degree of completeness of the CSS implementation across browsers and browser versions. Conditional-CSS is a solution to this problem, taking the idea of the conditional comment syntax from Internet Explorer and placing it inline with your CSS statements.
Basic usage
The main use of Conditional-CSS is to be able to indicate if a particular CSS statement should be sent to a particular browser or not. Of course you won’t wish to do this often, but it is exceptionally useful when you do need to target a browser. A very wide range of web browsers can be supported in this way, as can be seen by theĀ list that we support at U4EA.
Any CSS statement or block can be prefixed by a conditional statement, of which there are three basic types:
- [if {!} browser]
- [if {!} browser version]
- [if {!} condition browser version]
where:
- ! – indicates negation of the statement (i.e. NOT) – optional
- browser – states which browser the statement targets
- ‘IE’ – Internet Explorer
- ‘Gecko’ – Gecko based browsers (Firefox, Camino etc)
- ‘Webkit’ – Webkit based browsers (Safari, Chrome, Shiira etc)
- ‘SafMob’ – Mobile Safari (iPhone / iPod Touch)
- ‘Opera’ – Opera’s browser
- ‘IEMac’ – Internet Explorer for the Mac
- ‘Konq’ – Konqueror
- ‘IEmob’ – IE mobile
- ‘PSP’ – Playstation Portable
- ‘NetF’ – Net Front
- version – which version of the browser in question should be considered
- condition – arithmetic operator
- lt – Less than
- lte – Less than or equal to
- eq – Equal to
- gte – Greater than or equal to
- gt – Greater then