26 May 2005 Thursday
Adjacent selectors should work both ways
absurd that CSS thought to have adjacent selectors but didn’t have any provisions for targetting an element BEFORE another, not just after.
ie.
E + F { color: blue; }
will make the F immediately following an E be blue. ... so how the heck do you make an E immediately preceeding an F be blue?? ugh. so necessary. so unavailable.
“they’re” working on it, but ugh!
last-of-type should get here sooner than later, and precedents should have been targetable when descendents were.
p.s. i didn’t contribute anything to building it (CSS), so i don’t have tons of ground to complain on.. but… it just seems like it would have been such a sensible idea.. and i don’t know/understand what the deal is with CSS3 availability.. when? which browsers? how?
Comments on Adjacent selectors should work both ways
Which browsers? Well, Mozilla, Opera and Safari already support some CSS3 selectors. IE still doesn’t support a fair number of CSS2 selectors (including adjacent siblings), so I wouldn’t get my hopes up.
How? Kicking and screaming, as always.
Your live preview is misbehaving, btw.
nextSibling
will let you fake it with JavaScript.still a bit unsettled that they could think up the whole adjacent thing without considering the precedent thing.. maybe they had good reasons… maybe..
If you don't have one (and would like one), get a Gravatar.
Add your comment here: