gpt4 book ai didi

CSS nth-child 1-6、7-12 等

转载 作者:技术小花猫 更新时间:2023-10-29 11:16:16 24 4
gpt4 key购买 nike

我正在尝试按如下方式设置子元素的样式

1、7、13 等

2、8、14 等

3、9、15 等

4、10、16 等

5、11、17 等

6、12、18 等

我可以使用什么第 nth-child 语法来实现这一点?

最佳答案

你可以使用:nth-child(6n+1), :nth-child(6n+2), :nth-child(6n+ 3), :nth-child(6n+4)

引用文献:http://w3.org/TR/css3-selectors/#nth-child-pseudo , http://w3.org/TR/css3-selectors/#selectors (感谢@NayukiMinase)

另外,这里有一个很好的例子:Useful :nth-child Recipes - CSS-Tricks

关于CSS nth-child 1-6、7-12 等,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6984946/

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