Styling checkboxes that are even children
I have a whole bunch of checkboxes and want to style all the ones that are even children i.e 2nd, 4th, 6th, 8th.
I have tried doing the following but to no avail.
.basic li > di开发者_如何学Pythonv .choices input[type="checkbox"] {
width:14px;
height:14px;
float:left;
border:0 none;
background:#fff;
padding:0;
}
.basic li > div .choices input[type="checkbox"]:nth-child(2n-1) {
margin:0px 0px 0px 60px;
}
Use :nth-child(even)
or :nth-child(2n+0)
(any calculation resulting in an even integer) according to:
http://www.w3.org/TR/css3-selectors/
精彩评论