CSS zebra stripe en CSS3

Para crear el efecto zebra en css podemos utilizar la pseudo clase nth-child de CSS3

:nth-child( { number expression | odd | even } ) {
//declaracion block
}

Implementación

ul li:nth-child(odd) {
   background-color: silver;
}
Tagged with: , ,
Posted in Code Snippets, CSS Snippets

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">