我正在使用一个自命名的编号列表。如何读取 start-attribute 并使用 CSS 将其添加到计数器?
HTML
<ol>
<li>Number One</li>
<li>Number Two</li>
<li>Number Three</li>
</ol>
<ol start="10">
<li>Number Ten</li>
<li>Number Eleven</li>
<li>Number Twelve</li>
</ol>
CSS
ol {
list-style-type: none;
/* this does not work like I expected */
counter-reset: lis attr(start, number, 0);
}
li {
counter-increment: lis
}
li:before {
content: counter(lis)". ";
color: red;
}