CSS numbering using :before

See the below example to add numbering using :before


   ul {
      counter-reset: number;
   }
   ul li {
      counter-increment: number;
   }
   ul li::before {
      content: counter(number)" ";
   }



<ul>
  <li>List item<li>
  <li>List item<li>
  <li>List item<li>
  <li>List item<li>
  <li>List item<li>
</ul>


Example:

  • List item
  • List item
  • List item
  • List item
  • List item