html - Error in creating subclasses in CSS -
i have following code:
html
<ul class=sticky> <li> text1 </li> <li> text 2 </li> </ul>
css
.sticky ul li:nth-child(even) { -o-transform: rotate(4deg); -webkit-transform: rotate(4deg); -moz-transform: rotate(4deg); position: relative; top: 5px; background: #cfc; } .sticky ul li:nth-child(3n) { -o-transform: rotate(-3deg); -webkit-transform: rotate(-3deg); -moz-transform: rotate(-3deg); position: relative; top: -5px; }
but it's not working.. please me correct it. in advance
jsfiddle above code http://jsfiddle.net/czrg6/
.sticky ul
.sticky li:nth-child(even), { .sticky li:nth-child(3n), {
and need @ least 3 elements if you're using nth-child(3n), , can't see no anchor in fiddle.
if include anchor in <li>
elements remove commas
.sticky li:nth-child(even) { .sticky li:nth-child(3n) {
Comments
Post a Comment