我正在使用以下 css 来显示计步器:
:before {
content: "step " counter(fieldsets);
counter-increment: fieldsets;
/* Some more css */
}
但我想知道是否也可以显示元素的总数,如下所示:
:before {
content: "step " counter(fieldsets) " of " total_number_of_fieldsets;
counter-increment: fieldsets
/* Some more css */
}
我希望它是一个纯 CSS 解决方案,这可能吗?