Reputation: 752
I've tried adding an element in my CSS to remove the margin-right of every third div. Just seems to be effecting the 3rd and 7th for some reason though. Need it to work on 3rd, 6th, 9th etc...
CSS
.shopping-product { background-color: #fff; position: relative; border: 1px solid #eee; width: 200px; height: 250px; margin-right: 20px; float: left; padding-bottom: 20px; }
.shopping-product:nth-child(4n) { margin-right: 0; }
Is (4n) correct for every 3rd div?
Upvotes: 0
Views: 158
Reputation: 115232
Use 3n
instead which will select 3rd,6th,9th,....
.shopping-product:nth-child(3n) { margin-right: 0; }
Upvotes: 2