Selectors general de germans

This translation is incomplete. Please help translate this article from English.

Sumari

El combinador ~ separa dos selectores i coincideix amb el segon element només si està precedit pel primer, i tots dos comparteixen un pare comú.

Sintaxi

element ~ element { style properties }

Exemple

p ~ span {
  color: red;
}
<span>This is not red.</span>
<p>Here is a paragraph.</p>
<code>Here is some code.</code>
<span>And here is a span.</span>

Especificacions

Especificació Estat Comentari
Selectors Level 4
The definition of 'following-sibling combinator' in that specification.
Working Draft  
Selectors Level 3
The definition of 'general sibling combinator' in that specification.
Recommendation  

Característica Chrome Firefox (Gecko) Internet Explorer Opera Safari
Suport bàsic 1.0 1.0 (1.7 or earlier) 7 9 3
Característica Firefox Mobile (Gecko) Android IE Phone Opera Mobile Safari Mobile
Suport bàsic (Yes) (Yes) (Yes) (Yes) (Yes)

Veure

Document Tags and Contributors

 Contributors to this page: Legioinvicta
 Last updated by: Legioinvicta,