CSSRule.selectorText
and FindRule
span #fooBar .fooBar #fooFoo .fooFoo #barFoo #barBar.fooFoo
Given the following CSS rules...
span { color:red } #fooBar { color:orange } .fooBar { color:yellow } *#fooFoo { color:chartreuse } *.fooFoo { color:green } SPAN#barFoo { color:blue } SPAN.barFoo { color:purple } span.fooFoo.barBar { color:violet } span#barBar.fooFoo { color:black }
...here's what your browser says the selectors are:
Original CSS | Mozilla Flavors | IEWin v6 | IEMac v5.2.3 | Safari v1.2 |
---|---|---|---|---|
span #fooBar .fooBar *#fooFoo *.fooFoo SPAN#barFoo SPAN.barFoo span.fooFoo.barBar span#barBar.fooFoo | span #fooBar .fooBar #fooFoo .fooFoo span#barFoo span.barFoo span.fooFoo.barBar span#barBar.fooFoo | SPAN #fooBar .fooBar #fooFoo .fooFoo SPAN#barFoo SPAN.barFoo SPAN.barBar SPAN.fooFoo#barBar | SPAN *#fooBar *.fooBar *#fooFoo *.fooFoo SPAN#barFoo SPAN.barFoo SPAN.barBar SPAN.fooFoo#barBar | SPAN *[ID"fooBar"] .fooBar *[ID"fooFoo"] .fooFoo SPAN[ID"barFoo"] SPAN.barFoo[CLASS~="barFoo"] SPAN.fooFoo[CLASS~="fooFoo"].barBar SPAN[ID"barBar"].fooFoo |
document.styleSheets
at all, so none of the JS code will work.element.class1.class2
as simply element.class2
. (IEMac supports the syntax and just screws up the reporting; IEWin doesn't support the syntax at all, which is why '.fooFoo.barBar' in the Test Area at the top is huge and red on IEWin.)element#id.class
rules when reporting the selectorText
.SPAN.barFoo[CLASS~="barFoo"]
?!