2014-03-05 25 views
4

我嘗試在使用自定義項目符號的同時縮進破碎的li行,但是我在網上找到的任何減號「文本縮進」解決方案都沒有奏效 - 除非我遺漏了什麼。當使用自定義項目符號時,縮進破碎的li

有人可能會看看下面的代碼,並告訴我需要添加到indent破碎的li行嗎?

.list-icon-pros { 
    list-style: none; 
    padding-left: 0; 
} 
.list-icon-pros li:before {  
    font-family: FontAwesome; 
    color: #B3B300; 
    padding-right: 10px; 
    content: "\f00c"; 
} 
+0

使用這種小提琴,請描述你越是試圖達到的目標。 http://jsfiddle.net/ZwYyL/2/ – Mathias

+0

我已經添加了足夠長的子彈點來引起我所指的問題 - http://jsfiddle.net/ZwYyL/3/ – user3383616

+2

@ user3383616您可以將位置子彈作爲「絕對」來達到效果:http://jsfiddle.net/hashem/ZwYyL/4/ –

回答

9

您可以向僞元素添加負餘量,或者您可以使用position: absolute

位置絕對:http://jsfiddle.net/ZwYyL/6/

.list-icon-pros { 
    list-style: none; 
    padding-left: 20px; 
    position: relative; 
} 
.list-icon-pros li:before { 
    font-family: FontAwesome; 
    color: #B3B300; 
    content:"\f00c"; 
    position: absolute; 
    left: 0; 
} 

負保證金:http://jsfiddle.net/ZwYyL/5/

.list-icon-pros { 
    list-style: none; 
    padding-left: 22px; 
} 
.list-icon-pros li:before { 
    font-family: FontAwesome; 
    color: #B3B300; 
    content:"\f00c"; 
    margin:0 5px 0 -22px; 
} 
相關問題