Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 使用第n个子容器减少最后4个容器_Css - Fatal编程技术网

Css 使用第n个子容器减少最后4个容器

Css 使用第n个子容器减少最后4个容器,css,Css,我在我的主页上列出了许多产品,我使用第n个child元素来定位最后4个,以将底部边距减少到0,但似乎不起作用,我认为这是第n个child(5),第n个child(6)等等 实时url() 这里有一个片段 #layout #categories .box-1:nth-child(5) { margin-bottom: 0px; } #layout #categories .box-1:nth-child(6) { margin-bottom: 0px; } #layout #categories

我在我的主页上列出了许多产品,我使用第n个child元素来定位最后4个,以将底部边距减少到0,但似乎不起作用,我认为这是第n个child(5),第n个child(6)等等

实时url()

这里有一个片段

#layout #categories .box-1:nth-child(5) { margin-bottom: 0px; }
#layout #categories .box-1:nth-child(6) { margin-bottom: 0px; }
#layout #categories .box-1:nth-child(7) { margin-bottom: 0px; }
#layout #categories .box-1:nth-child(8) { margin-bottom: 0px; }

用这个!要覆盖的重要关键字如下:

保证金底部:10px!重要的

#layout #categories .box-1 {
width: 248px;
float: left;
margin-bottom: 10px !important;
margin-top: -140px;
margin-bottom: 150px;
}

用这个!要覆盖的重要关键字如下:

保证金底部:10px!重要的

#layout #categories .box-1 {
width: 248px;
float: left;
margin-bottom: 10px !important;
margin-top: -140px;
margin-bottom: 150px;
}

用这个!要覆盖的重要关键字如下:

保证金底部:10px!重要的

#layout #categories .box-1 {
width: 248px;
float: left;
margin-bottom: 10px !important;
margin-top: -140px;
margin-bottom: 150px;
}

用这个!要覆盖的重要关键字如下:

保证金底部:10px!重要的

#layout #categories .box-1 {
width: 248px;
float: left;
margin-bottom: 10px !important;
margin-top: -140px;
margin-bottom: 150px;
}

就像我昨天学到的,你可以这样做:

#layout #categories a:nth-last-of-type(-n+4) .box-1 {
    margin-bottom: 0;
}

n个子项
在父项中计数,因此当您查找
.box
n个子项
时,您的情况将始终只有一个子项。

如我昨天所学,您可以这样做:

#layout #categories a:nth-last-of-type(-n+4) .box-1 {
    margin-bottom: 0;
}

n个子项
在父项中计数,因此当您查找
.box
n个子项
时,您的情况将始终只有一个子项。

如我昨天所学,您可以这样做:

#layout #categories a:nth-last-of-type(-n+4) .box-1 {
    margin-bottom: 0;
}

n个子项
在父项中计数,因此当您查找
.box
n个子项
时,您的情况将始终只有一个子项。

如我昨天所学,您可以这样做:

#layout #categories a:nth-last-of-type(-n+4) .box-1 {
    margin-bottom: 0;
}

n个子项
在父项内计数,因此,当你在寻找
.box的第n个孩子时,在你的情况下永远只有一个孩子。

谢谢:)基本上你的答案从这里开始:谢谢:)基本上你的答案从这里开始:谢谢:)基本上你的答案从这里开始:谢谢:)基本上你的答案从这里开始:请不要过度使用像过度使用是另一回事。我刚才提到,可以这样做。请不要像那样过度使用重要的东西。过度使用是另一回事。我刚才提到,可以这样做。请不要像那样过度使用重要的东西。过度使用是另一回事。我刚才提到,可以这样做。请不要像那样过度使用重要的东西。过度使用是另一回事。我刚才提到,也可以这样做