我需要幫助才能獲得a., b.
樣式的內部縮進而不是2.2.1., 2.2.2.
。從HTML ordered list indent to keep original numbering使用HTML或CSS樣式縮進,如Word中的
發現原來CSS代碼我的代碼:
<style>
ol { counter-reset: item }
li { display: block }
li:before { content: counters(item, ".") ". "; counter-increment: item }
</style>
<ol>
<li>One</li>
<li>
Two
<ol>
<li>Two one</li>
<li>
Two two
<ol type="a">
<li>Two two a</li>
<li>Two two b</li>
</ol>
</li>
<li>Two three</li>
</ol>
</li>
<li>Three</li>
</ol>
什麼我越來越:
1. One
2. Two
2.1. Two one
2.2. Two two
2.2.1. Two two a
2.2.2. Two two b
2.3. Two three
3. Three
我需要什麼:
1. One
2. Two
2.1. Two one
2.2. Two two
a. Two two a
b. Two two b
2.3. Two three
3. Three
沒有額外的元素屬性和a,b ..的縮進長度與數字相同。謝謝 – BentCoder
這是一個聰明的解決方案,看起來像我將不得不讀一些有關計數器.. – MightyPork
@MightyPork謝謝!老實說,我瞭解了一點關於這個的計數器。我只是希望有一個更具規劃性的方式來做到這一點,而不是針對特定的列表級別。 – SlightlyCuban