title: how to validate IE 7/8 CSS hacks?
body: <p>I've used the conditional comments technique for my IE6/7/8 CSS "hacks", so that the main CSS file (with the common/standard classes) validates correctly (isolating the IE "hacks" in separate CSS files).</p>
  
  <p>Something like this:</p>
  
  <pre><code>&lt;!--[if IE 7]&gt;
  &lt;link href="css/layoutIE7.css" rel="stylesheet" type="text/css" /&gt;
  &lt;![endif]--&gt;
  </code></pre>
  
  <p>Now I've started using conditional comments to add a class to the <code>&lt;body&gt;</code> (please read this answer: <a href="https://stackoverflow.com/questions/6101314/css-if-statements-is-it-right/6101515#6101515">CSS if statements... is it right?</a> ) and then target the class that needs a "hack" in my main CSS file, this way I can have only one file.</p>
  
  <p>The problem with this method is that because I have everything in one file, it means that in case I have something as "simple" as the CSS3 <code>opacity</code> property:</p>
  
  <pre><code>.mydiv {
      opacity:0.6;
  }
  </code></pre>
  
  <p>The IE "counterpart" (i.e.: "hack") will have to be something like:</p>
  
  <pre><code>.mydiv {
      filter:alpha(opacity=60);
   }
  </code></pre>
  
  <p>Which doesn't validate correctly.</p>
  
  <p>I know the method I was using before still had this problem, but since you could test the site in a non-IE environment, it always validated (because I made sure the main CSS was valid), now since I'm trying to have one single CSS it doesn't validate (for the reasons explained).</p>
  
  <p>My question is how to add this "hacks" in a way that the validator considers it valid?</p>
  
  <p>Hopefully the answer should be CSS only.</p>