W3C home > Mailing lists > Public > www-style@w3.org > October 2007

Re: [CSS3 Selectors] proposal of pseudo-classes :odd-child and :odd-line

From: Anne van Kesteren <annevk@opera.com>
Date: Mon, 01 Oct 2007 15:09:41 +0200
To: nikn1@gazeta.pl, www-style <www-style@w3.org>
Message-ID: <op.tzir6fcz64w2qv@annevk-t60.oslo.opera.com>

On Mon, 01 Oct 2007 14:59:55 +0200, Nikodem <nikn1@gazeta.pl> wrote:
> table tr:odd-child // similar to :first-child
> {
> background:gray
> }
>
> <table>
> <tr><td>Odd </td><td>Row</td></tr> <!-- has gray background -->
> <tr><td>Even</td><td>Row</td></tr>
> <tr><td>Odd </td><td>Row</td></tr> <!-- has gray background -->
> <tr><td>Even</td><td>Row</td></tr>
> </table>

How is this different from :nth-child(odd) or :nth-child(even)?


> pre:odd-line // similar to :first-line
> {
> background:grey
> }
>
> <pre>
> Odd  line <!-- has gray background -->
> Even line
> Odd  line <!-- has gray background -->
> Even line
> </pre>

This would be a pseudo-element I assume? Although I agree it's useful,  
it's quite expensive too. (See also the archives for similar proposals.  
::line etc.)


-- 
Anne van Kesteren
<http://annevankesteren.nl/>
<http://www.opera.com/>
Received on Monday, 1 October 2007 13:09:51 GMT

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