IE7 doesn't support :last-child pseudo selector. I am thinking of explicitly adding a class name to denote it as the last element but not sure how to select this element inside a css file. Anyone have any ideas on how to do this ?
+7
A:
.class1.class2 {color:red}
and
<div class="class1 class2"></div>
or install IE7-js and :last-child will "just work".
SpliFF
2009-05-27 11:34:00
Note that IE6 is broken when it comes to multiple class selectors like this. http://www.ryanbrill.com/archives/multiple-classes-in-ie/ explains in more detail and has a work around.
David Dorward
2009-05-27 13:16:57
the IE7-js library is also a work-around, and it enables first/last-child as well. I love it.
SpliFF
2009-05-28 01:06:18
+2
A:
If you have
<div class="element"/>
<div class="element last"/>
You can just do
div.element
{
// styles effect both divs
}
div.last
{
// style will only effect the second element and overides because lower in the css
}
Nick Allen - Tungle139
2009-05-27 11:35:35
A:
One extra thing to note about multiple classnames is that IE6 can not handle them properly. It will only consider the last classname in the list:
.class1.class2 {color:red} => .class2 in IE6
PatrikAkerstrand
2009-05-27 11:55:13