2017-05-22 43 views
-3

请帮忙,我有一个列表,当我让段落更长时,排列不整齐,看起来很糟糕。我需要1.1例如缩进,并与其余整齐地排队......排列列表中的段落html/css

ol { 
 
    list-style-type: none; 
 
    counter-reset: item; 
 
    margin: 0; 
 
    padding: 0; 
 
} 
 

 
li { 
 
    display: table-row; 
 
    counter-increment: item; 
 
    margin-bottom: 0.6em; 
 
} 
 

 
li:before { 
 
    content: counters(item, ".") ". "; 
 
    display: inline-block; 
 
    margin: 0; 
 
    width: 40px; 
 
} 
 

 
li li { 
 
    margin: 0; 
 
}
<ol> 
 

 
<li><strong>Introduction</strong> 
 
    <ol> 
 
     <li>This document serves as an annexure to the Standard Terms and Conditions 
 
and its sole purpose is to set out the specific conditions applicable to the type 
 
of Finance Product you have selected to finance your Vehicle ("Annexure A").</li> 
 
     <li>Ullamco laboris nisi ut. 
 
      <ol> 
 
       <li>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. 
 
       </li> 
 
      </ol> 
 
     </li> 
 
    </ol> 
 
</li> 
 

 
<li><strong>Heading 2 </strong> 
 
    <ol> 
 
     <li>This document serves as an annexure to the Standard Terms and Conditions 
 
and its sole purpose is to set out the specific conditions applicable to the type 
 
of Finance Product you have selected to finance your Vehicle ("Annexure A").</li> 
 
     <li>Ullamco laboris nisi ut. 
 
      <ol> 
 
       <li>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. 
 
        
 
        <ol> 
 
        <li> Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur..</li> 
 
        </ol> 
 
       </li> 
 
      </ol> 
 
     </li> 
 
    </ol> 
 
</li> 
 

 
</ol>

+1

[删除ul缩进与CSS]可能的副本(https://stackoverflow.com/questions/9620594/removing-ul-indent-with-css) – Rob

回答

0
ol>li>ol>li li:before { 
    display: table-cell; 
} 

这是你的问题的原因,删除它,它所有的作品。

+0

谢谢你好我删除了,但看看当你做什么在列表中的文本分配更长,然后它不整齐地排列... –