Как я могу призвать список заказов CSS для отображения 1-2, 3-4, 5-6, 7-8 и т. Д.CSS

Разбираемся в CSS
Anonymous
Как я могу призвать список заказов CSS для отображения 1-2, 3-4, 5-6, 7-8 и т. Д.

Сообщение Anonymous »

Это мой заказ HTML < /p>

Код: Выделить всё

[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 */
}
, который не дает желаемых результатов

Подробнее здесь: https://stackoverflow.com/questions/794 ... -6-7-8-etc

Вернуться в «CSS»