如何删除每行最后一部分的右边距

时间:2013-10-25 10:04:45

标签: css3 grid css

我正在尝试为WordPress主题创建最多四列的网格。我用:

display:inline-block;

我还将我的部分垂直对齐到顶部:

vertical-align:top;

我在右侧使用边距来分隔每列。我需要删除每行最后一部分的右边距。为此,我尝试使用:

.twobg:nth-of-type(2n+2), .twodarkbg:nth-of-type(2n+2), .two:nth-of-type(2n+2), .twobgborder:nth-of-type(2n+2), .twobgdashedborder:nth-of-type(odd) {
margin-right: 0;
}

.threebg:nth-of-type(3n+3), .threedarkbg:nth-of-type(3n+3), .three:nth-of-type(3n+3), .threebgborder:nth-of-type(3n+3), .threebgdashedborder:nth-of-type(3n+3) {
margin-right:0;
}

.fourbg:nth-of-type(4n+4), .fourdarkbg:nth-of-type(4n+4), .four:nth-of-type(4n+4), .fourbgborder:nth--of-type(4n+4), .fourbgdashedborder:nth--of-type(4n+4) {
margin-right:0;
}

但是,当我使用它时,它会与我的其他网格混淆。我尝试了nth-child,但它做了同样的事情。我需要帮助!为什么这不起作用?我该怎么办?

在这里,您可以看到网格直播。 http://michellecantin.ca/test/features/grids/

我们将非常感谢您的帮助!

0 个答案:

没有答案
相关问题