Not sure if this is even possible, but I think it’s worth asking.
What I am trying to do is have boxes created via my PHP script with ease, where I don’t have to check which column, row, etc. each box (.boxes) belongs to. I just want to be able to do a foreach loop of the boxes, and echo them.
Here’s what I am talking about: http://jsfiddle.net/LUFFP/4/
In that example, you can see that I am trying to get the wrapper (#main) to ignore the margin-right, and have two boxes per row, with no extra space on the right, without having to assign different classes to every other DIV.
Any help is appreciated.
You can use
nth-of-type(2n)to target every other div. Then set the right margin to zero.http://jsfiddle.net/LUFFP/5/