mozilla

Compare Revisions

:only-child

Change Revisions

Revision 293395:

Revision 293395 by teoli on

Revision 386221:

Revision 386221 by ethertank on

Title:
:only-child
:only-child
Slug:
CSS/:only-child
CSS/:only-child
Tags:
css, CSS Reference, CSS Référence, Selectors
"css", "CSS Reference", "Selectors"
Content:

Revision 293395
Revision 386221
n4 n
5    <style type="text/css">
6<![CDATA[.example1 span:only-child {   color:red;}
7        ]]>  
8    </style>
n12    <p>n7    <div>
13      {{ CSSRef() }}8      {{CSSRef}}
14    </p>9    </div>
n19      The <code>:only-child</code> CSS <a href="/en/CSS/Pseudo-cln14      The <code>:only-child</code> CSS <a href="/en-US/docs/CSS/P
>asses" title="Pseudo-classes">pseudo-class</a> represents any ele>seudo-classes" title="Pseudo-classes">pseudo-class</a> represents
>ment which is the only child of its parent. This is the same as&n> any element which is the only child of its parent. This is the s
>bsp;<code>:first-child:last-child</code> or&nbsp;<code>:nth-child>ame as <code>:first-child:last-child</code> or <code>:nth-child(1
>(1):nth-last-child(1)</code>, but with a lower specificity.>):nth-last-child(1)</code>, but with a lower specificity.
n59    <h4 id="Live_example __ &lt;!.5BCDATA.5B.example1_span.3Aonlyn
>-child_.7B___color.3Ared.3B.7D .5D.5D&gt;__"> 
60      Live example
61    </h4>
nn140 
n150    <div class="eval">n143    <div>
n175            {{ SpecName('CSS4 Selectors', '#only-child-pseudo', 'n168            {{SpecName('CSS4 Selectors', '#only-child-pseudo', ':
>:only-child') }}>only-child')}}
176          </td>
177          <td>169          </td>
170          <td>
178            {{ Spec2('CSS4 Selectors') }}171            {{Spec2('CSS4 Selectors')}}
n186            {{ SpecName('CSS3 Selectors', '#only-child-pseudo', 'n179            {{SpecName('CSS3 Selectors', '#only-child-pseudo', ':
>:only-child') }}>only-child')}}
187          </td>
188          <td>180          </td>
181          <td>
189            {{ Spec2('CSS3 Selectors') }}182            {{Spec2('CSS3 Selectors')}}
n200    <p>n193    <div>
201      {{ CompatibilityTable() }}194      {{CompatibilityTable}}
202    </p>195    </div>
n234              {{ CompatGeckoDesktop(1.8) }}n227              {{CompatGeckoDesktop(1.8)}}
n280              {{ CompatGeckoMobile(1.8) }}n273              {{CompatGeckoMobile(1.8)}}
t295    <p>t
296      {{ languages( { "fr": "fr/CSS/:only-child" }) }}
297    </p>

Back to History