i have to create a progressbar timeline using html and css.Here is the snapshot of output: Output current Currently it is static on 4th number with all previous highlighted. what i want is that when user hover over 3 or 4 or any digit then all previous including current become active, i tried it but not yet success. here is my JSFiddle:https://jsfiddle.net/4ypjufmo/1/ Any Help is highly appreciated
@import "compass/css3";
li {
width: 2em;
height: 2em;
text-align: center;
line-height: 2em;
border-radius: 1em;
background: dodgerblue;
margin: 0 1em;
display: inline-block;
color: white;
position: relative;
}
li::before {
content: '';
position: absolute;
top: 0.9em;
left: -4em;
width: 4em;
height: 0.2em;
background: dodgerblue;
z-index: -1;
}
li:first-child::before {
display: none;
}
.active {
background: dodgerblue;
}
.active ~ li {
background: lightblue;
}
.active ~ li::before {
background: lightblue;
}
body {
font-family: sans-serif;
padding: 2em;
}