An ordered list in HTML that is numbered using odd numbers
I do not think that this can be achieved using regular ordered lists, because only available attributes are available (even including HTML5):
- type (indicates the type of numbering)
- start ( )
- reverse (, )
:
- (reset) ,
counter-reset.counter-reset. -1 ,li2, 1 ( -1 + 2 = 1). - 2 , a
li. . ,counter-increment2 : - , - , . :beforecontent.
ol {
counter-reset: odd-numbers -1;
list-style-type: none;
}
li {
counter-increment: odd-numbers 2;
}
li:before {
content: counter(odd-numbers) ". ";
}<ol>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>-1 li:first-child 1 ( counter-increment). li 2.
ol {
counter-reset: odd-numbers;
list-style-type: none;
}
li:first-child {
counter-increment: odd-numbers;
}
li {
counter-increment: odd-numbers 2;
}
li:before {
content: counter(odd-numbers) ". ";
}<ol>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>