开发者

CSS Counters - used with the content property only?

开发者 https://www.devze.com 2023-02-16 22:03 出处:网络
According to the spec, can/will CSS counters only be used in conjunction with the content property? * { content: counter(mycounter) \"! \"; counter-increme开发者_开发技巧nt: mycounter }

According to the spec, can/will CSS counters only be used in conjunction with the content property?

* { content: counter(mycounter) "! "; counter-increme开发者_开发技巧nt: mycounter }

Or can/will they also be used with other properties, such as (random example) padding?

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

Lastly, if that is a feature of CSS, to what extent is it implemented in browsers?


In CSS2.1, the counter() function is indeed defined for use with the content property only; you cannot use counters to specify numeric values for other properties.

0

精彩评论

暂无评论...
验证码 换一张
取 消