CSS Hack for IE Browser


CSS Hack Targeting IE8 and Below

<html>
<head>
<title>CSS Hack Targeting IE8 and Belowt</title>
<style type="text/css">
div {
/* for all browsers */
border: 1px solid #FF00FF; 

/* IE8 and below - red border */
border: 1px solid #FF0000\9; 
}
</style>
</head>
<body>

<div>CSS Hack Targeting IE8 and Below</div>

</body>
</html>
----------------------------------------------

CSS Hack Targeting IE7 and Below

<html>
<head>
<title>CSS Hack Targeting IE7 and Below</title>
<style type="text/css">
div {
/* for all browsers */
border: 2px solid #00FF00; 

/* IE8 and below - red border */
border: 2px solid #FF0000\9;

/* IE7 and below - pink border */
*border: 2px solid #FF00FF; 
}
</style>
</head>
<body>

<div>CSS Hack Targeting IE7 and Below</div>

</body>
</html>
----------------------------------------------------

CSS Hack Targeting IE6 and Below

<html>
<head>
<title>CSS Hack Targeting IE6 and Below</title>
<style type="text/css">
div {
/* for all browsers */
border: 2px solid #00FF00; 

/* IE8 and below - red border */
border: 2px solid #FF0000\9;

/* IE7 and below - pink border */
*border: 2px solid #FF00FF; 

 /* IE6 and below - blue border */
_border: 2px solid #00f;

}
</style>
</head>
<body>

<div>CSS Hack Targeting IE6 and Below</div>

</body>
</html>
Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s