Forum Moderators: not2easy
Any help with this problem would be much appreciated.
Here's the basic code:
<style type="text/css" media="screen"><!--
.details
{
height: 300px;
border: solid 1px #d6d6d6;
color: #585858;
font: 12px/18px Arial;
width: 548px;
margin: 0 0 30px;
padding: 20px;
}
.sticker {
position: relative;
border: 1px solid #7c78fd;
margin: -20px -40px 0 0;
right: 0px;
float: right;
width: 123px;
height: 120px;
}
--></style>
</head>
<body>
<div class="details">
<div class="sticker">
</div>
</div>
</body>
That way you can target IE6 without risk to the compliant browsers (it's all a comment in the html to them), and you can easily target specific IE versions to give them a workaround for their bugs).
Tip: don't target IE8 ... it'll have to do with the standards compliant code and hence force Microsoft into making/keeping it compliant.
How I use it nowadays:
<link rel="stylesheet" type="text/css" href="/style.css" />
<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="/ie6.css" />
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="/ie7.css" />
<![endif]-->
The "style.css" is applied to all browsers, including IE.
The ie6.css and ie7.css files are just applied on top of the style.css to IE6 and IE7 respectively.
Sometimes you run into a stuation where IE6 and IE7 need exactly the same fixes
<link rel="stylesheet" type="text/css" href="/style.css" />
<!--[if lt IE 8]>
<link rel="stylesheet" type="text/css" href="/ie-pre8.css" />
<![endif]-->