0

I have an ordered list. I already know I can change the displayed index of any given term with the value field:

<ol>
    <li value=6> ... </li>
    <li value=3> ... </li>
    <li value=99> ... </li>
</ol>

This displays something along the lines of:

6. ...
3. ...
99. ...

when it gets parsed.

What if I want my list index to be 6.5, or some other non-integer number? When I try

<li value="6.5"> ... </li>

it still just parses as

6. ...
Green Cloak Guy
  • 23,793
  • 4
  • 33
  • 53

1 Answers1

1

OL/LI tags support only integer numbers, so you cannot do it with pure HTML.

Here is example how you can use li:before CSS to put custom content.

ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
li:before {
  display: inline-block;
  content: attr(value);
}
li.half:before {
  display: inline-block;
  content: attr(value) ".5";
}
<ol>
    <li value=4> ... </li>
    <li value=6 class="half"> ... </li>
    <li value=10> ... </li>
</ol>
Iłya Bursov
  • 23,342
  • 4
  • 33
  • 57