Reputation: 99
I want to run :last-child in ie 7. I know its not possible with only css but i added jquery Heres the following code in js
$('#columncontainer > div:nth-child(even)').addClass("mar-right");
and my html is
<div id="columncontainer"> <div class="list-type"></div> <div class="list-type"></div> </div>
is there anything missing with ie7 and ie8 else this code is working every where in browser.
Upvotes: 1
Views: 948
Reputation: 2281
i tried your code and script .it works fine for me in ie7 and ie8 please refer the link.
Upvotes: 0
Reputation: 14827
:last-child doesn't work in IE7, try this instead:
$('#columncontainer').last().addClass('mar-right');
Upvotes: 1
Reputation: 35973
IE7 doesn't support nth-child
See this link to view all browser compatibility
to solve this problem you can add a class with jquery and select it into your css file like this:
$('#columncontainer:nth-child(even)').addClass('mar-right');
Upvotes: 0