Topic: Zebra Pattern using CSS (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=21845" title="Pages that link to Topic: Zebra Pattern using CSS (Page 1 of 1)" rel="nofollow" >Topic: Zebra Pattern using CSS <span class="small">(Page 1 of 1)</span>\

 
templar654
Bipolar (III) Inmate

From: Aiur, the Tarsonian Galaxy
Insane since: Apr 2004

posted posted 05-18-2004 10:33

I've been trying to make one of those zebra like patterns in CSS but the problem is that the only way I found out how to do it is by adding a different class to each of the <li> elements. Thats pretty hectic does anyone know of a better or easier way to do it?


Online Portfolio

HZR
Bipolar (III) Inmate

From: Cold Sweden
Insane since: Jul 2002

posted posted 05-18-2004 10:46

In current CSS specs, you can't construct a selector that selects every other <li>. In CSS 3, you will probably be able to do something like

code:
li:nth-child(odd)

.
Either give them a class (maybe alternate them server-side) or use JavaScript.

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 05-18-2004 10:51

http://alistapart.com/articles/zebratables/

ozphactor
Maniac (V) Inmate

From: Kah-lee-fohr-nee-ah
Insane since: Jul 2003

posted posted 05-20-2004 20:46

The CSS3 :nth-child selector that HZR referred to has actually been implemented in Firefox nightlies sometime after 0.8. Another reason why I love Fx.



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu