treehouse : what would you like to learn today?
Web Design Web Development iOS Development

[Solved] Is this a safe IE8 hack?

  • This seems to be a perfect way to target IE8. Anything I'm overlooking here?

    #onoff li+li+li a {
    float:left; /* Target IE8 */
    margin-right:-14px; /* Target IE8 */
    }
    #onoff li:nth-child(2) a, #onoff li:nth-child(3) a {
    position:absolute; /* Cancel target IE8 */
    z-index:1;
    color:green;
    font-weight:bold;
    margin:0; /* Cancel target IE8 */
    }
    
  • This is not a really hack, but sure it works since IE8 doesn't understand :nth-child() pseudo-selectors.

    However it will also target IE7 as far as I know.

  • Yeah I guess 7 too. No bigy

  • Thanks