"My name is danran" asked in the wed group, "can I select the first element of an element for the CSS selector ?" Impressions: _ descendant
> Parent-child
+ Younger brother
~ Younger siblings
Are all backward searched .... Not found. That is, it can only be found after the reference node. The advantage of backward searching is that the direction of searching is one-way. If forward searching is supported AlgorithmA lot of trouble... However, the demand of tudan is also reasonable. I went to view the draft of css4 at night and found a similar solution:
Selector subject definition :"! "
Http://dev.w3.org/csswg/selectors4/#subject
If the browser is actually implemented, you can use the following simple sentence to meet the requirements of the earth:
! Div + # myid {color: Red}/* a DIV in front of myid is set to a red font... */
The subject definition is clever. On the one hand, it satisfies the requirements of the earth, and does not change the direction of selector. Very nice.
In addition, ecmascript V4 is down, so there is no reason to worry about the fate of css4...