CSS3 pseudo selector emulation for Internet Explorer 5-8

ie-css3.js is a CSS3 pseudo selector emulation for internet explorer that allows Internet Explorer to identify CSS3 pseudo selectors and render any style rules defined with them. Simply include the script in your pages and start using these selectors in your style sheets.

To use ie-css3.js file in your project You’ll need to download Robert Nyman’s DOMAssistant and ie-css3.js and include them both in your WebPages and then insert CSS files with the <link> tag (inline styles are not supported) will make the rules work. only :not() pseudo selector is not supported by ie-css3.js.

How does it work ?

  • ie-css3.js downloads each style sheet on the page and parses it for CSS3 pseduo selectors. If a selector is found it’s replaced by CSS class of a similar name. For example: div:nth-child(2) will become div._iecss-nth-child-2.
  • Next, Robert Nyman’s DOMAssistant is used to find the DOM nodes matching the original CSS3 selector and the same CSS class is applied them.
  • Finally, the original stylesheet is replaced with the new version and any elements targeted with CSS3 selectors will be styled.

Supported pseudo selectors

  • :nth-child
  • :nth-last-child
  • :nth-of-type
  • :nth-last-of-type
  • :first-child
  • :last-child
  • :only-child
  • :first-of-type
  • :last-of-type
  • :only-of-type
  • :empty

Download : ie-css3.js