W3C home > Mailing lists > Public > www-style@w3.org > December 2001

:nth-of-type & parallel construction

From: fantasai <fantasai@escape.com>
Date: Sat, 29 Dec 2001 11:54:57 -0500
Message-ID: <3C2DF561.F91FE4E4@escape.com>
To: www-style@w3.org
Just as a note for future reference, since its too late to change it now -

"nth-of-type" would be better written as "nth-child-of-type" for
two reasons:
                   1. Clarifies the scope - you can tell it's the nth
                      sibling of that type, and not the nth of type in
                      the entire document, without looking it up
                   2. Parallel construction |
                                            V 

:nth-of-type does not have the same grammatical construction
as :nth-child. In :nth-of-type, 'nth' is the noun being
described. In :nth-child, 'nth' is the adjective describing
the noun 'child'.

:nth-child()      :nth-of-type()       :nth-child-of-type()
 adj. n.           n.  ` adj. '         adj.   n. ` adj. '
                 (of type is an        (of type is an adjective
                 adjective phrase;      phrase; it describes
                 it describes 'nth')    'child')

:nth-last-child()
 adj. adj. `n.'
:nth-last-of-type()
 adj.  n.  `adj.'

:first-child()
  adj.  n.
:first-of-type()
  n.    `adj.'

:last-child()
  adj.  n.
:last-of-type()
  n.  `adj.'

With the :nth-child pseudos, the noun is always 'child'
With :nth-of-type, the noun switches among 'nth', 'last', and 'first'
Received on Saturday, 29 December 2001 11:52:07 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:11 GMT