2016-06-21 33 views
0

嘗試了很多事情並搜索了網頁後,我仍無法找到如何在圖像左側顯示的圖標之間創建類似的垂直線。有人有關如何實現這一目標的想法?任何幫助都感激不盡!!如何在圖標之間創建垂直線(使用示例圖像)

enter image description here

+0

將是很好,如果有一個像.. –

+1

歡迎SO。請訪問[幫助]並參加[導覽],瞭解如何以及要問什麼。提示:郵政編碼和努力 – mplungjan

+0

請解釋更好的問題,也許增加一些圖像和你迄今爲止嘗試過的。你越具體,越有可能獲得幫助。 – reallynice

回答

0

爲sanjeev說,你可以僞代碼之前使用之前,這裏是它是如何做。運行代碼段時,請在完整頁面中查看。不知道錯誤代碼是什麼。

.timeline { 
 
    position: relative; 
 
    margin: 10px 0; 
 
    padding: 0; 
 
    list-style: none; 
 
    counter-reset: section; 
 
} 
 
.timeline:before { 
 
    content: ''; 
 
    position: absolute; 
 
    top: 0; 
 
    bottom: 0; 
 
    width: 3px; 
 
    background: #fdb839; 
 
    left: 32px; 
 
    margin: 0; 
 
    border-radius: 2px; 
 
} 
 
.timeline > li { 
 
    position: relative; 
 
    margin-right: 10px; 
 
    margin-bottom: 50px; 
 
    padding-top: 18px; 
 
    box-sizing: border-box; 
 
    padding-left: 90px; 
 
} 
 
.timeline > li:before, 
 
.timeline > li:after { 
 
    display: block; 
 
} 
 

 
.timeline > li:before { 
 
    counter-increment: section; 
 
    content: counter(section); 
 
    background: #fdb839; 
 
    width: 70px; 
 
    height: 70px; 
 
    position: absolute; 
 
    top: 0; 
 
    border-radius: 50%; 
 
    left: -1px; 
 
    display: flex; 
 
    justify-content: center; 
 
    align-items: center; 
 
    color: #Fff; 
 
    font-size: 22px; 
 
    font-weight: bold; 
 
    border: 15px solid #fff; 
 
    box-sizing: border-box; 
 
} 
 
.timeline > li:after { 
 
    clear: both; 
 
}
<ul class="timeline"> 
 
    <li> 
 
    asdfasdf 
 
    </li> 
 
    <li> 
 
    asdfsdf 
 
    </li> 
 
</ul>

+0

謝謝。它適合我。 –

0

可以使用CSS創建它:選擇

+0

下面是一個示例如何完成:https://jsfiddle.net/v5stsyta/7/ –