Using javascript to force IE 7-9 to properly parse CSS like modern browsers?

Hello,

Sorry if I posted this in the wrong forum section. I have read just been doing basic research and came across this script from a article I read here: (I needed a way to apply a style to li elements without it affecting the li elements of nested lists within each li. At the moment every li was being affected)

Here is the script:

The script doesn’t seem to have been updated since 2010, but I was wondering whether anyone have utilized it and if there are any other known popular scripts that seem stable for a production site?

Also on a side note, anyone know if the next IE version will finally properly use CSS?

thanks in advance.

Umm…what you want has been possible since IE 7. No script is needed. Also IE 8+ has the most complete implementation of CSS 2.1 as any other browser. (Just everyone is “Lets implement CSS3 before we even nailed down the previous version!!!”)

#some-id-on-ul-element > li { ... }

You need to improve your research, IE has properly used CSS for a while now.

As logic said the child selector has been supported since IE7 so there is no need for that script. I assume you are using a full doctype otherwise you will be in quirks mode and then the browser will behave much like ie5.

(I needed a way to apply a style to li elements without it affecting the li elements of nested lists within each li

You can do that anyway for IE6 by simply restating the original styles on the nested list.

e.g.


li{background:red}
li li {background:blue}