gpt4 book ai didi

javascript - 带有数字填充的 CSS 计数器

转载 作者:行者123 更新时间:2023-11-30 13:45:44 25 4
gpt4 key购买 nike

<分区>

是否可以根据其值填充 counter 数字?

div {
counter-reset: ruler;
}

div > span {
display: block;
line-height: 1rem;
}

div > span::before {
counter-increment: ruler;
content: counter( ruler ) ' ';
}
<div>
<span>Hello, World!</span>
<span>Hello, World!</span>
<span>Hello, World!</span>
<span>Hello, World!</span>
<span>Hello, World!</span>
<span>Hello, World!</span>
<span>Hello, World!</span>
<span>Hello, World!</span>
<span>Hello, World!</span>
<span>Hello, World!</span>
<span>Hello, World!</span>
<span>Hello, World!</span>
<span>Hello, World!</span>
</div>

如果有 42 行,数字将像 09 9,420 — 009 9.

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