简体   繁体   English

样式化甚至是儿童的复选框

[英]Styling checkboxes that are even children

I have a whole bunch of checkboxes and want to style all the ones that are even children ie 2nd, 4th, 6th, 8th. 我有一堆复选框,并且希望为所有样式设置样式,甚至是孩子,例如2nd,4th,6th,8th。

I have tried doing the following but to no avail. 我尝试执行以下操作,但无济于事。

.basic li > div .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: 根据以下条件使用:nth-child(even):nth-child(2n+0) (任何得出偶数整数的计算):

http://www.w3.org/TR/css3-selectors/ http://www.w3.org/TR/css3-selectors/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM