我们可以检索到CSSli 的默认计数器值?
例如:
如果我有 6 个<li>
, 分成 2<ol>
,但我想要<li>
从 1 到 6 列出,而不是从 1 到 3 列出两次。我用了value="4"
在第一个<li>
第二个的<ol>
,所以它有效,但现在因为我正在使用
ol {
counter-reset: i 0;
}
ol li:before {
content: counter(i);
counter-increment: i;
font-weight: bold;
}
The content: counter(i);
不考虑value="4"
在第一个<li>
第二个的<ol>
.
我能做点什么吗?
View on JsFiddle http://jsfiddle.net/MC8aP/
这适合您的需求吗?在 JSFiddle 上查看 http://jsfiddle.net/Hg4yg/
HTML
<ol>
<li>test</li>
<li>test</li>
<li>test</li>
</ol>
<ol>
<li>test</li>
<li>test</li>
<li>test</li>
</ol>
CSS
ol:first-of-type {
counter-reset: i 0;
}
ol li:before {
content: counter(i);
counter-increment: i;
font-weight: bold;
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)