Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 30th, 2012  |  syntax: None  |  size: 0.32 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Using CSS :even and :odd pseudo-classes with list items
  2. li { color: blue }
  3. li:nth-child(odd) { color:green }
  4. li:nth-child(even) { color:red }
  5.        
  6. li:nth-child(even) {
  7.     color:green;
  8. }
  9.        
  10. li:nth-child(odd) {
  11.     color:red;
  12. }
  13.        
  14. li { color:blue; }
  15. li:nth-child(odd) { color:green; }
  16. li:nth-child(even) { color:red; }