Grow your CSS skills. Land your dream job.

IE7 picking up IE6 hack * html

  • # June 1, 2010 at 9:20 am

    Hi,

    Has anyone come across an issue in CSS where the IE7 browser picks up the IE6 hack (* html) and so renders the CSS assigned to IE6 rather than the CSS for IE7?

    I have used the following code:

    .maincontent{
    float: left;
    width: 600px;
    margin: 0px 0px 0px 25px;
    background-image: url(http://images.itc-uk.com/websiteimages/ … odybg1.gif);
    background-repeat: no-repeat;
    }

    * html .maincontent{
    float: left;
    width: 600px;
    margin: 0px 0px 0px 12px;
    background-image: url(http://images.itc-uk.com/websiteimages/ … odybg1.gif);
    background-repeat: no-repeat;
    }

    The styles in .maincontent are meant for Firefox and IE7 and the styles in * html .maincontent are meant for IE6, however the IE7 browser is picking up the styles in * html .maincontent and so is breaking the design. I have tried applying the * :first-child+html hack so as to apply styles only for IE7 however the browser is still pinking up the * html.

    I am an in-house designer for a UK based travel firm and this code is for an enewsletter.

    It appears that the IE7 browser has only started picking up the * html .maincontent styles today.

    Any help would be massively appreciated, as I’m starting to tear my hair out.

    Regards

    Gavin

    # June 1, 2010 at 1:00 pm

    Why don’t you just use an IE6 specific stylesheet?

    # June 1, 2010 at 4:17 pm

    If it is just that 1 block of code and you don’t want to use an IE6 specific style sheet you could use *+html which targets IE7 but i would recommend you use an IE6 stylesheet.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".