Appropriate Selections
Published 21 years, 2 weeks pastOkay, a lot of you have managed to come up with puns and jokes similar to the one I first saw at Jay Allen‘s site, and Dunstan Orchard has taken the whole theme to the (il)logical conclusion. One of the most common puns I’ve seen is:
#ericmeyer:first-child
Amusing, yes, but here’s the problem: that describes any element with an id
of ericmeyer
that is the first child of another element. Now, I can be described that way; I am the oldest of my parents’ two children. But it doesn’t describe Carolyn, unless we accept the convention that a child’s id
should be given a value with his or her father’s name. Such a convention would limit every father to one child, which might make for excellent social policy but seems unnecessarily restrictive from a structural point of view.
So, while this particular little joke validates, it doesn’t do what the author(s) intended, probably due to the widespread lack of understanding about what :first-child
actually does.
You’re supposed to be describing her, people, not me! Every time you write an inappropriate selector, it makes the Baby Carolyn cry. You wouldn’t want to make her cry, would you?
A selector that does describe her is:
#ericmeyer :first-child
…which is functionally equivalent to:
#ericmeyer *:first-child
Both will select any element that is the first child of another element and is also descended from an element with an id
of ericmeyer
. This would also select the first children of any children that I have, so first grandchildren (and so on) would be members of the same set. Thus, it might make slightly more sense to use the following:
#EricMeyer > :first-child
…which is to say, any element that’s the first child of an element whose id
is EricMeyer
—more precisely, any element that is the first child of another element and is also the child of an element with an id
of EricMeyer
. I suppose that this particular selector could describe many children, as I expect I’m not the only ‘EricMeyer’ (and yes, the capitalization matters) in the world to have had a child. But it should, at least within the confines of my docu—er, my family tree, select Carolyn uniquely.
Here endeth the lesson.
At another time of year, I might have struggled with what kind of music to play for Carolyn. Big Band? Classical? Hard rock? Some blues, maybe? “Weird Al”? Fortunately, there is no dilemma, as we’re pretty much playing holiday music front to back. Jiminy Cricket sings “From All Of Us To All Of You” about twenty times a day. Good thing I have a fondness for that record. I’m still going to get Handel’s “Messiah,” Bach’sBeethoven’s “Ode To Joy,” and a few other pieces from Bombastic Dead White Guys into the mix. Plus “Santa Baby” as sung by Eartha Kitt. May as well start with the confusion early!
I’ve just read, much to my confusion, that Diana Krall and Elvis Costello were married in Elton John’s mansion, thus forming a Weirdness Trifecta. I mean, hey, if they’re happy with each other, I’m all for it, but those just aren’t names I would have put into the same sentence. Ever.