2017-02-12 111 views
1

我想实现我的网站如下:创建对齐圈中有一个圆圈和文字上边的垂直线

enter image description here

显然,这应该能够去更多迭代,我真的不知道该怎么样谷歌,我找到了创建一条线的方法,但我不知道如何将它与Circles结合起来,以及如何使它们与文本对齐。

最终代码:

* { 
    box-sizing: border-box; 
} 

ul { 
    margin: 0; 
    padding: 0; 
    list-style-type: none; 
} 

ul li div { 
    width: 50%; 
    float: left; 
    text-align: center; 
} 

ul li .zero-left { 
    position: relative; 
    color: #EB908B; 
    width: 30%; 
    text-align: right; 
    padding-right: 20px; 
} 

ul li .zero-right { 
    border-left: 3px solid #3C4C4C; 
    position: relative; 
    color: #3C4C4C; 
    width: 70%; 
    padding-left: 15px; 
    text-align: left; 
} 

ul li .first { 
    position: relative; 
    color: #EB908B; 
    width: 30%; 
    text-align: right; 
    padding-right: 20px; 
} 

ul li .second { 
    border-left: 3px solid #3C4C4C; 
    position: relative; 
    width: 70%; 
    padding-left: 15px; 
    text-align: left; 
} 

ul li .second p { 
    color: #EB908B; 
    position: relative; 
    text-align: left; 
} 

ul li .first::before { 
    content: ''; 
    position: absolute; 
    right: -11.5px; 
    width: 20px; 
    height: 20px; 
    border-radius: 150%; 
    border: 2px solid #3C4C4C; 
    background: #3C4C4C; 
    z-index:9999 
} 
+0

您可以使用此:http://stackoverflow.com/a/41982653/4206079作为基础 – Banzay

回答

0

可以使用after伪元素放循环。在这里我用after解决方案做了一个例子。

jsfiddle

+0

好吧,我已经更新了它的左,宽度70%一点点(宽度30%左),非常感谢! – 4c74356b41