I am trying to use the awesome jquery masonry plugin -> http://desandro.com/resources/jquery-masonry/
The plugin works just fine, however I have problems creating a layout where I use an nth-child() selector to get rid of a margin-right on every third element.
#footerwidgets li.widget {
margin: 0px 24px 24px 0px;
width:340px;
}
#footerwidgets li.widget:nth-child(3n) {
margin-right:0px;
}
Since my container for this widget is exactly 1068px wide, three widgets fit in perfectly (because the last widget has no right margin).
When I try to use the jquery masonry plugin, this behaviour gets ignored! Only two columns fit in. (The plugin works, so all widgets get floated in masonry style.) When I inspect the elements, every third element has a right margin of 24px as well. So nth-child is ignored.
Any way to make that working?
nth-child
selector is CSS 3, so the support is still a bit limited. Internet Explorer doesn't support it until version 9. – Guffa