2

Is it possible to define a style for an ordered list that renders something like

<ol>
   <li>Item 1</li>
   <li>Item 2</li>
   <li>Item 3</li>
</ol>

as

(1) Item 1

(2) Item 2

(3) Item 3

j08691
  • 204,283
  • 31
  • 260
  • 272
Michael Tobisch
  • 1,034
  • 6
  • 15

1 Answers1

7

You can use css counter and :before pseudo-element to create this type of list.

ol {
  counter-reset: custom;
  list-style-type: none;
}

ol li:before {
  content: '('counter(custom)') ';
  counter-increment: custom;
}
<ol>
   <li>Item 1</li>
   <li>Item 2</li>
   <li>Item 3</li>
</ol>
Nenad Vracar
  • 118,580
  • 15
  • 151
  • 176