我想要像这样输出:
1-2 number one
3-4 number two
5-6 number three
这是我已经尝试过的 HTML-CSS 代码
ol {
list-style : none; /* Remove default numbering */
counter-reset : item 0; /* Start counter at 0 */
}
li {
display : block;
counter-increment : item 2; /* Increment by 2 for each item */
}
li:before {
/* Display as '1-2', '3-4', etc. */
content : counter(item) "-" counter(item, decimal) " ";
font-weight : bold;
counter-increment : item; /* Increment again to get the second number */
}
<ol class="custom-list">
<li>number one</li>
<li>number two</li>
<li>number three</li>
</ol>
这并没有产生预期的结果... :/