Monday, January 7, 2013

Using "nth-of-type" with IE8

IE8 apparently doesn't support the CSS selector "nth-of-type".

You can fix it by adding this script to your page: https://github.com/keithclark/JQuery-Extended-Selectors/blob/master/jquery-extra-selectors.js

You will also need to add the following script to the bottom of your page (of course you will need to swap the numbers with your own):

$("div:nth-of-type(1)").css("background", "#b44835");


I used this to fix an IE8 compatibility issue with something called InfoGrid: http://css-tricks.com/examples/InfoGrid/

No comments:

Post a Comment