Conditional-CSS

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]

1. // Conditional-CSS syntax examples

2. [if IE] - Used if the browser is IE

3. [if ! Opera] - Used if the browser is not Opera

4. [if IE 5] - Used if browser is IE 5

5. [if lte IE 6] - Used if the browser is IE 6 or less (IE 5, IE 4 etc)

6. [if ! gt IE 6] - Same effect as the previous statement, if not greater than IE 6

This entry was posted on Thursday, August 14th, 2008 at 1:51 am and is filed under css. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply

You must be logged in to post a comment.