gpt4 book ai didi

CSS :nth-child() style every 2nd and 3rd for same color and so on

转载 作者:行者123 更新时间:2023-12-02 07:32:14 24 4
gpt4 key购买 nike

如何按此顺序设置链接样式:

一红、二蓝、三蓝、四红、五红、六蓝、七蓝等。有图片示例:

enter image description here

最佳答案

我会这样做。

li:nth-child(4n+1),
li:nth-child(4n+4) {
background-color: red;
}

li:nth-child(4n+2),
li:nth-child(4n+3) {
background-color: blue;
}

关于CSS :nth-child() style every 2nd and 3rd for same color and so on,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20617110/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com