--- title: Selettore di Figli Diretti slug: Web/CSS/Child_combinator tags: - compinatori css - selettore di figli diretti translation_of: Web/CSS/Child_combinator original_slug: Web/CSS/selettore_figli_diretti ---
selettore1 > selettore2 {stili CSS }
span { background-color: white; } div > span { background-color: DodgerBlue; }
<div> <span>Span 1. In the div. <span>Span 2. In the span that's in the div.</span> </span> <span>Span 3. In the div</span> </div> <span>Span 4. Not in a div at all.</span>
{{EmbedLiveSample("Example", 200, 100)}}
Specification | Status | Comment |
---|---|---|
{{SpecName('CSS4 Selectors', '#child-combinators', 'child combinator')}} | {{Spec2('CSS4 Selectors')}} | |
{{SpecName('CSS3 Selectors', '#child-combinators', 'child combinators')}} | {{Spec2('CSS3 Selectors')}} | No change |
{{SpecName('CSS2.1', 'selector.html#child-selectors', 'child selectors')}} | {{Spec2('CSS2.1')}} | Initial definition |
{{CompatibilityTable}}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
supporto di base | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | 7.0 | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
supporto di base | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |