24 ways to impress your friends

Jump to menu

Vote down?

John Faulds

How about instead of using last-child do things on the other side of your objects (margin-left/border-left etc) and use the more widely accepted first-child?

That’s exactly what I do. I use Dean Edwards’ IE7.js as mentioned by Paul D. Waite which brings support for :first-child to IE6 as well and then add all margins, padding and borders on the left of elements.

Using IE7.js you can also take advantage of the CSS2.1 selectors you talk about in your form example for IE6. The one area where I’ve had trouble has been targetting particular labels but I’m going to try out the htmlfor trick and see how it goes.