Skip to content

Commit 42bc9b4

Browse files
committed
[selectors] Apply the better :nth-child() text to :nth-last-child() as well.
1 parent cb7e297 commit 42bc9b4

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

selectors/Overview.bs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2658,9 +2658,10 @@ Child-indexed Pseudo-classes</h3>
26582658
'':nth-last-child()'' pseudo-class</h4>
26592659

26602660
The <dfn id='nth-last-child-pseudo' title=":nth-last-child()">:nth-last-child(<var>An+B</var> [of <var>sel</var>]? )</dfn>
2661-
pseudo-class notation represents an element that has <var>An+B</var>-1 siblings
2662-
<em>after</em> it in the document tree
2663-
which match the <a>selector list</a> <var>sel</var>.
2661+
pseudo-class notation represents the <var>An+B</var>th element
2662+
which matches the <a>selector list</a> <var>sel</var>
2663+
among its siblings,
2664+
counting backwards from the end.
26642665

26652666
The CSS Syntax Module [[!CSS3SYN]] defines the <a href="http://dev.w3.org/csswg/css-syntax/#anb"><var>An+B</var> notation</a>.
26662667
If <var>sel</var> is omitted,

selectors/Overview.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2877,9 +2877,10 @@ <h4 class="heading settled" data-level=12.4.2 id=the-nth-last-child-pseudo><span
28772877
<a class=css data-link-type=maybe href=#nth-last-child-pseudo title=:nth-last-child()>:nth-last-child()</a> pseudo-class</span><a class=self-link href=#the-nth-last-child-pseudo></a></h4>
28782878

28792879
<p>The <dfn class=css data-dfn-type=selector data-export="" id=nth-last-child-pseudo title=:nth-last-child()>:nth-last-child(<var>An+B</var> [of <var>sel</var>]? )<a class=self-link href=#nth-last-child-pseudo></a></dfn>
2880-
pseudo-class notation represents an element that has <var>An+B</var>-1 siblings
2881-
<em>after</em> it in the document tree
2882-
which match the <a data-link-type=dfn href=#selector-list title="selector list">selector list</a> <var>sel</var>.</p>
2880+
pseudo-class notation represents the <var>An+B</var>th element
2881+
which matches the <a data-link-type=dfn href=#selector-list title="selector list">selector list</a> <var>sel</var>
2882+
among its siblings,
2883+
counting backwards from the end.</p>
28832884

28842885
<p>The CSS Syntax Module <a data-biblio-type=normative data-link-type=biblio href=#biblio-css3syn title=CSS3SYN>[CSS3SYN]</a> defines the <a href=http://dev.w3.org/csswg/css-syntax/#anb><var>An+B</var> notation</a>.
28852886
If <var>sel</var> is omitted,

0 commit comments

Comments
 (0)