Internet Explorer Conditional Statements

Syntax
<!--[if IE 7]>
 HTML Code only shows up on Internet Explorer 7
<![endif]-->
Conditional Operators
Operator Description Example
! not <!–[if ! IE 7]>
lt less than <!–[if lt IE 7]>
gt greater than <!–[if gt IE 7]>
lte less than or equal <!–[if lte IE 7]>
gte greater than or equal <!–[if gte IE 7]>
<style type="text/css">
.MyStyle {
 background-color: red;
 <!--[if lt IE 7]>
  background-color: blue;
 <![endif]-->
}
</style>
<style type="text/css">
.MyStyle {
 background-color: red;
}
</style>

<!--[if lt IE 7]>
<style type="text/css">
.MyStyle {
 background-color: blue;
}
</style>
<![endif]-->
Advertisements

1 Comment »

  1. Find Internet Explorer…
    http://rakaz.nl/2004/11/conditional-comments.html

RSS feed for comments on this post · TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: