mozilla

Compare Revisions

:nth-child

Change Revisions

Revision 333411:

Revision 333411 by teoli on

Revision 333567:

Revision 333567 by ethertank on

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

Revision 333411
Revision 333567
n7    <p>n7    <div>
8      {{ CSSRef() }}8      {{CSSRef}}
9    </p>9    </div>
n14      The <code>:nth-child</code> <a href="/en-US/docs/CSS" titlen14      The <code>:nth-child</code> <a href="/en-US/docs/CSS" title
>="/en-US/docs/CSS">CSS</a> <a href="/en/CSS/Pseudo-classes" title>="CSS">CSS</a> <a href="/en-US/docs/CSS/Pseudo-classes" title="Ps
>="Pseudo-classes">pseudo-class</a> matches an element that has <c>eudo-classes">pseudo-class</a> matches an element that has <code>
>ode><em>a</em>n+<em>b</em>-1</code> siblings before it in the doc><em>a</em>n+<em>b</em>-1</code> siblings before it in the documen
>ument tree, for a given positive or zero value for <code>n</code>>t tree, for a given positive or zero value for <code>n</code>, an
>, and has a parent element.>d has a parent element.
n28    <pre class="eval">n28    <pre>
n66        Represents a span element which is the first child of itsn66        Represents a span element which is the first child of its
> parent; this is the same as the {{ Cssxref(":first-child") }} se> parent; this is the same as the {{Cssxref(":first-child")}} sele
>lector.>ctor.
n83    <div>n
84      <h3 id="Odd_Selector_Example" name="Odd_Selector_Example">83    <h3 id="Odd_Selector_Example" name="Odd_Selector_Example">
85        Odd Selector Example84      Odd Selector Example
86      </h3>85    </h3>
87      <p id="The_following_HTML...">86    <p id="The_following_HTML...">
88        The following HTML...87      The following HTML...
89      </p>88    </p>
90      <pre class="brush:html">89    <pre class="brush:html">
n99      <p id="...using_this_CSS...">n98    <p id="...using_this_CSS...">
100        ...using this CSS...99      ...using this CSS...
101      </p>100    </p>
102      <pre class="brush:css; highlight:[1]">101    <pre class="brush:css; highlight:[1]">
n108      <p id="...will_result_in.3A">n107    <p id="...will_result_in.3A">
109        ...will result in:108      ...will result in:
110      </p>109    </p>
111      <div>110    <div>
112        {{ EmbedLiveSample('Odd_Selector_Example','550', '30') }}111      {{EmbedLiveSample('Odd_Selector_Example','550', '30')}}
113      </div>
n135            {{ SpecName('CSS4 Selectors', '#nth-child-pseudo', ':n133            {{SpecName('CSS4 Selectors', '#nth-child-pseudo', ':n
>nth-child') }}>th-child')}}
136          </td>
137          <td>134          </td>
135          <td>
138            {{ Spec2('CSS4 Selectors') }}136            {{Spec2('CSS4 Selectors')}}
n146            {{ SpecName('CSS3 Selectors', '#nth-child-pseudo', ':n144            {{SpecName('CSS3 Selectors', '#nth-child-pseudo', ':n
>nth-child') }}>th-child')}}
147          </td>
148          <td>145          </td>
146          <td>
149            {{ Spec2('CSS3 Selectors') }}147            {{Spec2('CSS3 Selectors')}}
n161      {{ CompatibilityTable() }}n159      {{CompatibilityTable}}
n194              {{ CompatGeckoDesktop("1.9.1") }}n192              {{CompatGeckoDesktop("1.9.1")}}
t240              {{ CompatGeckoMobile("1.9.1") }}t238              {{CompatGeckoMobile("1.9.1")}}

Back to History