I have some CSS that goes something like this:
table.TableStyle {font-family: "Helvetica", "Ariel"; background-
color:white; border-collapse:collapse;}
table.TableStyle COLGROUP[id="ColGroup0"] { background-
color:lavender;}
The second line is a style that is applied to a particular named
COLGROUP element in tables assigned the TableStyle class.
Unfortunately, while this works in most modern browsers (including
IE7), it fails in IE6, which I've discovered doesn't support attribute
selectors.
This could be worked around by assigning the COLGROUP a style
(<COLGROUP class="Style0">, for instance). But that would be less
nifty if the table was changed from "TableStyle" to, say,
"AnotherStyle" (perhaps via a Javascript DOM call), since the COLGROUP
would have to be altered as well. I assume that I'm out of luck if I
want to support IE6 with the existing attribute selector method?
Also, it looks like IE6 doesn't even parse attribute selectors
properly, much less apply them? I tried defining an attribute
selector and a regular one together using the CSS grouping syntax, so
at least the style info would only be defined once:
..EvenStyle, table.TableStyle COLGROUP[id="ColGroupEven"] { background-
color: #DCDCDC; }
this works in the other browsers, but fails with IE6 - "EvenStyle"
doesn't get defined, so I'm assuming their parser choked on the
attribute selector and ignored the entire declaration?