gpt4 book ai didi

CSS 计数器 - 仅与内容属性一起使用?

转载 作者:行者123 更新时间:2023-11-28 08:38:33 25 4
gpt4 key购买 nike

根据规范,CSS 计数器是否只能与 content 属性结合使用?

* { content: counter(mycounter) "! "; counter-increment: mycounter }

或者它们也可以/将与其他属性一起使用,例如(随机示例)padding

/*
is this possible?
is this supposed to be possible?
*/
* { padding:counter(mycounter)px; }

最后,如果这是 CSS 的一个特性,它在浏览器中的实现程度如何?

最佳答案

在 CSS2.1 中,counter() function确实被定义为仅与 content 属性一起使用;您不能使用计数器为其他属性指定数值。

关于CSS 计数器 - 仅与内容属性一起使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5283117/

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