sikas sikas - 13 days ago 5
HTML Question

Custom ordered list format

I tried to use ordered list

<ol>
and each list item
<li>
outputs as 1. 2. 3. ... etc, I want the output to be 1) 2) 3) ... etc, can this be done?

Answer

You can, but only with the more up-to-date browsers (Chrome, Safari, Firefox and Opera will work):

ol {
  counter-reset: listCounter;
}
ol li {
  counter-increment: listCounter;
}
ol li:before {
  content: counter(listCounter) ")";
}