Blog

Some of my recent posts and ramblings.

Conditional CSS styles for IE6 in the stylesheets

I never knew about this, guess I never bothered to check but you can have conditional styles for different versions of IE right inside your stylesheets.

Source: CSS Tricks

To Target only IE6

* html #div {
    width:978px;
}

To Target only IE7

*+html #div {
    width:978px;
}

To Target both IE6 and IE7 (this is mine :) ), add a comment as shown. IE6 and 7 interpret the comment as well.

#div {
    width:980px;
    //width:978px;
}

 


Leave a Reply

Your email is never published nor shared. Required fields are marked *

You may use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>