我有一个关于nth-child()
and的问题nth-of-type()
,我尝试了这两种变体,但都不起作用。这是我的代码:
#commentdamcherirounded:nth-child(odd) {
border-radius:4px;
-moz-border-radius:4px;
-o-border-radius:4px;
-webkit-border-radius:4px;
-khtml-border-radius:4px;
width:680px;
display:block;
margin-bottom:15px;
position:relative;
margin-top:-16px;
background-repeat:repeat-y;
background-color:red;
}
#commentdamcherirounded:nth-child(even) {
border-radius:4px;
-moz-border-radius:4px;
-o-border-radius:4px;
-webkit-border-radius:4px;
-khtml-border-radius:4px;
width:680px;
display:block;
margin-bottom:15px;
position:relative;
margin-top:-16px;
background-repeat:repeat-y;
background-color:yellow !important;
}