2016-03-01 86 views
0

當我使用自定義計數器,當有在第二行縮進一個問題..列表樣式 - 第二行縮進使用計數器

我不能使用「列表樣式類型:十進制」作爲它不放棄編號爲下面。

 
1 first 
2 second 
    2.1 second.one ..... .. .. 
    But INDEDNT lost when spilled to second line 
    2.2 second.two 
3 Three 

所以我用一個自定義的計數器,這給了我想要的編號,這個問題只與第二行縮進。

PEN here

ol { 
    counter-reset: ci-counter; 
    list-style-postion: inside; 
    list-style-type: none; 
    padding-left: 0px; 
    margin-top: 0; 
    margin-bottom: 11px; 
    } 

    ol li:before { 
    content: counters(ci-counter, ".")" "; 
    counter-increment: ci-counter; 
    } 

回答

1

編輯檢查我的問題,你的HTML這樣

.img-cntr { 
 
    padding: 0; 
 
    margin: 0 10px 10px 0; 
 
    float:left; 
 
} 
 

 
ol { 
 
    counter-reset: ci-counter; 
 
    list-style-postion:inside; 
 
    list-style-type: none; 
 
    padding-left: 0px; 
 
    margin-top: 0; 
 
    margin-bottom: 11px; 
 
} 
 

 
ol li:before { 
 
    content: counters(ci-counter, ".") " "; 
 
    counter-increment: ci-counter; 
 
}
<div class="cntr" style="width:40%"> 
 
     <div class="img-cntr"> 
 
     <image src="http://www.hdwallpapery.com/static/images/image5_170127819_PxgeF3V.jpg" height="200px"/> 
 
     </div> 
 
     
 
     <ol> 
 
     <li>On average every day, across the organisation</li> 
 
     <li>we spend at hours a day on the phone 
 
     <ol><li>test</li></ol> 
 
     </li> 
 
     <li>to the IT Service Desk, with average wait times per</li> 
 
    </ol> 
 
     
 
    </div>

+0

嗨,難道我的解決方案可以幫助您? –