How do I make Pseudo classes work with Internet Explorer 7/8?

Posted by Mel on Stack Overflow See other posts from Stack Overflow or by Mel
Published on 2010-03-09T02:19:33Z Indexed on 2010/03/09 2:21 UTC
Read the original article Hit count: 189

Filed under:
|
|

I've written the following code to create a three-column layout where the first and last columns have no left and right margins respectively:

#content {
    background-color:#edeff4;
    margin:0 auto 30px auto;
    padding:0 30px 30px 30px;
    width:900px;
}
    .column {
        float:left;
        margin:0 20px;
    }
    #content .column:nth-child(1) {
        margin-left:0;
    }
    #content .column:nth-child(3) {
        margin-right:0;
    }

The problem is that this code does not work in Internet Explorer 7 and 8? The only pseudo class I can use with IE (in this case) would be "first-child," but this does not eliminate the right margin on the third and last column. Does anyone know of a way I can make this code work on IE 7/8?

© Stack Overflow or respective owner

Related posts about css

Related posts about pseudo-class