timshel.


Composition

This entry is made up of 146 words. It was last modified in May 2005.

A free permalink available.

There have been 3 comments made to this article. Would you like to add another?

"He who forgets, will be destined to remember..."

26 May 2005 Thursday

Adjacent selectors should work both ways

slated in site-building at 03:16 AM

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

When? Good question. I’d guess next year sometime at the soonest.

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.
commented on Thu, May 26 2005, 07:05:15 AM :: permalink
Also, if you ever absolutely need a “reverse” adjacent sibling selector, the DOM2 method nextSibling will let you fake it with JavaScript.
commented on Thu, May 26 2005, 07:07:39 AM :: permalink
good to know about nextSibling, thank you…
still a bit unsettled that they could think up the whole adjacent thing without considering the precedent thing.. maybe they had good reasons… maybe..
commented on Thu, May 26 2005, 07:22:35 PM :: permalink
Subscribe to XML comments feed for this article

Want to be one of the cool kids with an image next to your comments? Get a Gravatar.

Add your comment here:

*Your comment will NOT be sent until you hit SUBMIT after previewing.