Alternate styles (odd,even) with css3
For exemple, alternate colors through list items with :
li:nth-child(odd) {
background: #ddd;
}
li:nth-child(even) {
background: #eee;
}
I use it combined with a ol list to represent a CSV file content like this :
<ol class="csv-lines">
<li>first line</li>
<li>second line</li>
<li>etc</li>
</ol>
I like things light and simple. Voilà !
Written by Jérémie Ducastel
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Css
Authors
Related Tags
#css
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#