How to add css for even odd li elements

This is the code by which i apply alternate css to my li elements –


.stream li { }
.stream li:nth-child(odd) { background:#CCCCCC; }
.stream linth-child(even) { background:#00FFCC; }

Advertisements
Posted in CSS

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s