Created
October 7, 2016 03:36
-
-
Save anilmeena/42c6f85ff4902c07317afdecc6cc941e to your computer and use it in GitHub Desktop.
Change even/odd rows background colors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
.container { | |
width:600px; | |
margin:0 auto; | |
} | |
.row { | |
line-height:24pt; | |
border: solid 1px black; | |
} | |
.row:nth-of-type(2n+1) | |
background: #ccc; | |
} | |
.row:nth-of-type(2n) | |
background: #eee; | |
} | |
h3 { | |
line-height:36pt; | |
font-weight:bold; | |
color:blue; | |
} | |
</style> | |
<div class="container"> | |
<h3>Title</h3> | |
<div class="row">Content</div> | |
<div class="row">Content</div> | |
<div class="row">Content</div> | |
<div class="row">Content</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment