P粉7648364482023-08-22 20:00:10
Use this style to only change nested lists:
ol { counter-reset: item; } ol > li { counter-increment: item; } ol ol > li { display: block; } ol ol > li:before { content: counters(item, ".") ". "; margin-left: -20px; }
P粉1419112442023-08-22 14:47:16
Uncheck "Standardize CSS" - http://jsfiddle.net/qGCUk/3/ The CSS reset used in this sets the margins and padding of all lists to 0
UPDATE http://jsfiddle.net/qGCUk/4/ - You must include your sublist in the main <li>
ol { counter-reset: item } li { display: block } li:before { content: counters(item, ".") " "; counter-increment: item }
<ol> <li>one</li> <li>two <ol> <li>two.one</li> <li>two.two</li> <li>two.three</li> </ol> </li> <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> <li>four</li> </ol>