I would like to add a vertical line between each circle, however when using a :before pseudo element this doesn't show the border. When I remove the flex box parent then the lines appear.
How can I achieve this without having to remove the flexbox, as I need to have the text in line with the numbered circles.
https://jsfiddle.net/p3gt02yb/1/
.circle {
position: relative;
border: 2px solid #999;
border-radius: 100%;
width: 50px;
line-height: 50px;
text-align: center;
margin-top: 50px;
background-color: #fff;
z-index: 2;
}
.circle:first-child {
margin-top: 0;
}
.circle:before {
position: absolute;
border: 1px solid #999;
width: 0;
height: 50px;
display: block;
content: '';
left: 50%;
z-index: 1;
top: -54px;
margin-left: -1px;
}
.circle:first-child:before {
display: none;
}
.flex {
display: flex;
align-items: center;
}
.text-padding {
padding: 0 15px;
}
<section>
<div class="flex">
<div class="circle">1</div>
<strong class="text-padding">Lorem Ipsum Dollar</strong>
</div>
<div class="flex">
<div class="circle">2</div>
<strong class="text-padding">Lorem Ipsum Dollar</strong>
</div>
<div class="flex">
<div class="circle">3</div>
<strong class="text-padding">Lorem Ipsum Dollar</strong>
</div>
<div class="flex">
<div class="circle">4</div>
<strong class="text-padding">Lorem Ipsum Dollar</strong>
</div>
<div class="flex">
<div class="circle">5</div>
<strong class="text-padding">Lorem Ipsum Dollar</strong>
</div>
</section>