I'm facing some difficulty with the .half-circle:nth-child
class in my CSS. I am attempting to set a varying margin-left value for each absolutely positioned <div>
within the same class, but I am unable to achieve the desired result.
.header-paymentback-panel{
position: relative;
float: left;
width: 225px;
height: 150px;
background: #f5f5f5;
border: 2px solid #eaeaea;
border-radius: 5px;
display: inline-block;
}
.half-circle {
position: absolute;
bottom: -2px;
float: left;
width: 45px;
height: 30px;
background-color: #fff;
border-top-left-radius: 60px;
border-top-right-radius: 60px;
border: 2px solid #eaeaea;
border-bottom: 0;
}
.half-circle:nth-child(n) {
margin-left: /* (20px * item index) */
}
HTML:
<div class="header-paymentback-panel">
<div class="half-circle"></div>
<div class="half-circle"></div>
<div class="half-circle"></div>
</div>
I would greatly appreciate any assistance on this matter.