IE7 and IE8 hack behavior

We’ve had the luxury of hacks to fine tune Internet Explorer bugs. Internet Explorer 7 disabled the majority of hacks, with the exception of the * hack. This hack allowed you to send a style only to Internet Explorer by prefacing an attribute with an asterisk.


/*this is for all browsers*/
#main p {color:black;}
/* this is for Internet Explorer */
#main *p {color:red;}
/*this is ignored by IE7 and will target IE6 */
#main _p {color:green;}

This set of hacks allowed us to control IE7 and IE6. However, IE8 does not recognize the * hack. Special IE8 rules will either need to be defined with conditional comments, the Microsoft proposed meta tag, or some new hack to be discovered. Let’s hope the mature version of IE8 will reduce the need for these hacks.

For more information on the above hacks, visit an earlier post: IE7 Hacks


4 Responses to “IE7 and IE8 hack behavior”  

  1. 1 Boris Masis

    Thanks for pointing out the lack of support for the * hack. I expanded on it at http://www.borism.net/2009/03/19/anti-ie8-css-hack/

    Rock on,
    - Boris

  2. 2 Dok de Leon

    found this while searching for someone who might have had the same experience I had about a “comma” hack/filter for IE8… This seems the closest.

  3. 3 karl

    Mmhh…

    #main *p {color:red;}

    is done by Safari, too.

  1. 1 (anti) IE8 CSS Hack at Boris Masis - Personal Homepage


Leave a Reply


Powered by WP Hashcash