Discuss: Keeping Your Elements’ Kids in Line with Offspring
by Alex Bischoff
- Editorial Comments
2 jQuery as another option?
Could many of the concepts discussed be implemented using jQuery as well?
posted at 06:02 am on February 05, 2008 by Jacob Boomgaarden
3 Typo in the article's code
There’s a missing closing <code> tag immediately above the heading “All together now”, which makes the last half of the article pretty hard to read.
In a more legitimate comment, I’d also be interested to see Offspring ported to something like jQuery or (my personal preference) Mootools.
posted at 06:43 am on February 05, 2008 by Ian Beck
5 On Safari and do-it-all libraries, respectively
Fantastic work. Well done. Just one note—it is my understanding and experience that Safari does not implement last-child.
@ Jacob Boomgaarden : Yes, jQuery could certainly do this. However, many developers don’t want and many projects don’t need the overhead of that type of library. Offspring seems to be about doing one thing and doing it well.
posted at 07:00 am on February 05, 2008 by Ben Spaulding
6 Another one on Safari
Ben is right about Safari not supporting the last-child selector.
posted at 07:15 am on February 05, 2008 by Kari Pätilä
8 Using jQuery
On mid-to-large projects, where using a complete library is needed, such a script would be useless.
And using jQuery for example, would yield much more flexible results, as its CSS selectors are very complete.
I am, by no means, trying to flame here, but i really don’t see the point of a js library that does trivial things.
Wouldn’t it be better to simply use pure js to accomplish this? I mean, if you only need the first-child of the navigation, its much faster to do:
var nav-items = document.getElementById(‘nav’).getElementsByTagName(‘li’); nav-items0.class = ‘first-child’;
posted at 09:26 am on February 05, 2008 by Andrei Eftimie
9 Untitled
Might be worth having another look at Dean Edwards’ ie7 (and now ie8) script. He’s done some re-writing, and I believe it performs a bit better now.
Of course, Offspring and ie7/8 solve different problems, albeit with some overlap.
posted at 09:56 am on February 05, 2008 by Paul Waite
10 Untitled
Unfortunately Opera also does not support the CSS 3 selector :last-child so it only works in Mozilla based browers.
posted at 10:24 am on February 05, 2008 by Fonts K
Got something to say?
Discuss this article. We reserve the right to delete flames, trolls, and wood nymphs.
Create a new account or sign in below if you’d like to leave a comment.
Subscribe to this article's comments: RSS (what’s this?)


1 measure page rendering time
my i know what u used to mesure the time taken?
posted at 05:07 am on February 05, 2008 by thirukumaran kubendran