css select :nth-of-child(1) 不工作

css select :nth-of-child(1) not working

所以我试图让最近促销活动中的第一个宽框(底部)比其他框的高度更高,但是 nth-of-child 不起作用,我只需要它宽框。这是代码:

#listify_widget_recent_listings-2 .job_listing-entry-header:nth-child(1) {
height: 400px !important;
}

当您删除 :nth-of-child 时,它会使该小部件中的所有框都按预期变大,所以我不确定为什么它第一次不起作用。求助!

请试试这个

#listify_widget_recent_listings-2 .job_listings li:nth-child(1) .job_listing-entry-header.listing-cover.has-image {
    height: 400px !important;
}

如有遗漏请评论