Alternate background colors for list items

前端 未结 9 1832
一向
一向 2020-12-04 07:42

I have a list, and each item is linked, is there a way I can alternate the background colors for each item?

9条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-04 08:34

    Try adding a pair of class attributes, say 'even' and 'odd', to alternating list elements, e.g.

    
    

    In a