RE: [WSG] Use CSS to target last 2 list items

2010-02-22 Thread Thierry Koblentz
> Just wondering, is it possible to use the nth-child in CSS2 to target
>  the last 2 items of an unordered list? 
>
> I know you can do nth-last-child, but I wanted to target the last TWO
>  list items. Is this possible?

I believe this is CSS*3*, so support is not that great


--
Regards,
Thierry 
www.tjkdesign.com | www.ez-css.org


 



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***



Re: [WSG] Use CSS to target last 2 list items

2010-02-22 Thread Phil Archer

Paul,

A quick look at [1] suggests that you might be able to do

li:nth-last-child(-n+2)

But I haven't tried it...

(I didn't know you could target the last element so I was intrigued by 
your question and that lead me to this. Don't assume that all W3C team 
folk know what each other is up to!)


Phil.

[1] http://www.w3.org/TR/css3-selectors/#nth-last-child-pseudo

Paul Collins wrote:

Hi all

Just wondering, is it possible to use the nth-child in CSS2 to target the
last 2 items of an unordered list?

I know you can do nth-last-child, but I wanted to target the last TWO list
items. Is this possible?

Thanks for any help


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***


--


Phil Archer
W3C Open Media Web
http://www.w3.org/

http://philarcher.org



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***



[WSG] Use CSS to target last 2 list items

2010-02-22 Thread Paul Collins
Hi all

Just wondering, is it possible to use the nth-child in CSS2 to target the
last 2 items of an unordered list?

I know you can do nth-last-child, but I wanted to target the last TWO list
items. Is this possible?

Thanks for any help


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***