gpt4 book ai didi

css - 如何在中途反转循环?

转载 作者:行者123 更新时间:2023-11-28 17:36:35 24 4
gpt4 key购买 nike

我有这个代码:

for i in (1..5) 
div:nth-child({i})::after
content \'i*i\'

for i in (6..10)
div:nth-child({i})::after
ij = (i - 5)
content \'(ij*ij)\'

for i in (1..10)
div:nth-child({i})
ij = (i - 5)
if i >= 6
height ij * ij px
else
height i * i px

输出这个:

enter image description here

但我需要它在 25 点反转,所以它是:

1 4 9 16 25 25 16 9 4 1

不确定该怎么做?

最佳答案

改变计算 ij 的方式,从 ij = (i - 5)ij = 11 - i

for i in (1..5) 
div:nth-child({i})::after
content \'i*i\'

for i in (6..10)
div:nth-child({i})::after
ij = 11-i
content \'(ij*ij)\'

for i in (1..10)
div:nth-child({i})
ij = 11-i
if i >= 6
height ij * ij px
else
height i * i px

关于css - 如何在中途反转循环?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24996135/

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