
Is it possible to achieve something like the image above? So far I have tried the following code.
.greyParent {
height: 19px;
border-radius: 7px;
background: rgb(196, 196, 196);
}
.greyParent > .activeSlide {
background: rgb(0, 97, 188);
border-radius: 7px;
border-right: 1px solid #fff;
float: left;
width: 20%;
height: 19px;
position: absolute;
}
.greyParent > .activeSlide:first-child {
left: 0%;
z-index: 5;
}
.greyParent > .activeSlide + .activeSlide {
left: 16%;
z-index: 4;
}
<div class="col-xs-4 col-sm-2 col-md-2">
<span class="slideNo">1/5</span>
</div>
<div class="col-xs-8 col-sm-10 col-xs-9 progressImage">
<div class="greyParent">
<div class="activeSlide">
</div>
<div class="activeSlide">
</div>
</div>
</div>
Run codeHide resultI need to add the div.activeSlide div tag depending on the tab. The problem I am facing is that I am adding 5 div.activeSlide tags for the fifth slide without occupying the entire parent div tag ie div.greyParent. I understand that since I am in an absolute position and trying to move divs to the right, this happens. But since I need to highlight the border of each section, I had to use the absolute position. Can someone help me with this? Is there any solution for this?
source
share