0

I have have a nested unordered list.

I want the list to start at "1.2.1,1.2.2 ...".

Please see attached fiddle.

Desired outcome is:

enter image description here

   OL { counter-reset: item; padding-left: 10px; }
   LI { display: block }
   LI:before { content: counters(item, ".") " "; counter-increment: item }
<html>
 <head>
  <style>
   OL { counter-reset: item; padding-left: 10px; }
   LI { display: block }
   LI:before { content: counters(item, ".") " "; counter-increment: item }
  </style>
 </head>
 <body>
 <ol>
  <li>three
  <ol>
   <li>three.one</li>
   <li>three.two
    <ol>
     <li>three.two.one</li>
     <li>three.two.two</li>
    </ol>
      </li>
   </ol>
   </li>  
  </ol>
 </body>
</html>

Thanks!

user1525612
  • 1,864
  • 1
  • 21
  • 33
  • https://stackoverflow.com/questions/3635955/how-to-create-a-1-1-1-2-1-3-html-list found answer here, closing thanks! – user1525612 Apr 25 '22 at 11:51
  • why does it have to be an unordered list? do you not have access to the HTML? – Sigurd Mazanti Apr 25 '22 at 11:51
  • FYI: _"I have have a nested unordered list"_ - no you don't, you have _ordered_ lists, that's what the "o" in `ol` stands for after all. An *u*nordered list is `ul`. – CBroe Apr 25 '22 at 12:05

1 Answers1

0

use the tag Instead

 <head>
  <style>
   OL { counter-reset: item; padding-left: 10px; }
   LI { display: block }
   LI:before { content: counters(item, ".") " "; counter-increment: item }
  </style>
 </head>
 <body>
 <ul>
  <li>three
  <ul>
   <li>three.one</li>
   <li>three.two
    <ul>
     <li>three.two.one</li>
     <li>three.two.two</li>
    </ul>
      </li>
   </ul>
   </li>  
  </ul>
 </body>
</html>````