mozilla

Compare Revisions

:only-child

Change Revisions

Revision 35218:

Revision 35218 by vikashagrawal1990 on

Revision 35219:

Revision 35219 by teoli on

Title:
:only-child
:only-child
Slug:
CSS/:only-child
CSS/:only-child
Tags:
css, "CSS Reference", Selectors
css, "CSS Reference", Selectors
Content:

Revision 35218
Revision 35219
nn4 
5    <style type="text/css">
6<![CDATA[.example1 span:only-child {   color:red;}
7        ]]>
8    </style>
nn32    <h3>
33      Basic example
34    </h3>
n28div span:only-child {n36span:only-child {
n34    &lt;span&gt;Some red text&lt;/span&gt;n42    &lt;span&gt;This span is the only child of its father&lt;/spa
 >n&gt;
n38    &lt;span&gt;Some regular text&lt;/span&gt;n46    &lt;span&gt;This span is one of the two children of its fathe
 >r&lt;/span&gt;
39    &lt;span&gt;Some regular text&lt;/span&gt;47    &lt;span&gt;This span is one of the two children of its fathe
 >r&lt;/span&gt;
nn50    <h4>
51      Reference result
52    </h4>
t43      <pre class="eval">t54      <span style="color:red;">This span is the only child of its
 > father</span>
44<span style="color:red;">Some red text</span>55    </div>
45<span>Some regular text</span> <span>Some regular text
46</span>
47</pre>
48    </div>56    <div>
57      <span>This span is one of the two children of its father</s
 >pan><span>This span is one of the two children of its father</spa
 >n>
58    </div>
49    <hr>59    <h4>
60      Live example
61    </h4>
62    <div class="example1">
63      <span>This span is the only child of its father</span>
64    </div>
65    <div class="example1">
66      <span>This span is one of the two children of its father</s
 >pan> <span>This span is one of the two children of its father</sp
 >an>
67    </div>
68    <h3>
69      A list example
70    </h3>

Back to History