0
I have a gallery that will repeat, every five photos, it jumps down.
Only when the element is the fifth, or =5, I want you to apply a margin-right=0
.
My HTML:
<ul class="galeria">
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
My CSS:
.galeria li:first-child + li + li + li + li + li {
margin-right: 0!important;
}
Okay, this is working perfectly, but what about when it’s element 10, 15, 20?
I wouldn’t want to have to put a ,
in my CSS and repeat the property, there is an easier way? there is sum for it? that works pro IE8
I used the
+li +li +li
instead ofnth-child
because of IE8– Felipe Viero Goulart