[list]
[*]number one
[*]number two
[*]number three
[/list]
< /code>
И я хочу вывести, как < /p>
1-2 номер один < /p>
3-4 номер два < /p>
5-6 номер три < /p>
Это мой код CSS, который я попробовал < /p>
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 {
content: counter(item) "-" counter(item, decimal) " "; /* Display as '1-2', '3-4', etc. */
font-weight: bold;
counter-increment: item; /* Increment again to get the second number */
}
Это мой заказ HTML < /p> [code][list] [*]number one [*]number two [*]number three [/list] < /code> И я хочу вывести, как < /p> 1-2 номер один < /p> 3-4 номер два < /p> 5-6 номер три < /p> Это мой код CSS, который я попробовал < /p> 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 { content: counter(item) "-" counter(item, decimal) " "; /* Display as '1-2', '3-4', etc. */ font-weight: bold; counter-increment: item; /* Increment again to get the second number */ } [/code] , который не дает желаемых результатов