<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Progress Steps</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<ul class="progress-bar">
<li class="active">Step 1</li>
<li>Step 2</li>
<li>Step 3</li>
</ul>
</div>
</body>
</html>
body{
margin: 0;
padding: 0;
box-sizing: border-box;
}
.container{
width: 100%;
/* outline: 1px solid red */
}
.progress-bar{
counter-reset: step;
}
.progress-bar{
}
.progress-bar li{
list-style: none;
float: left;
width: 33.3%;
position: relative;
/* outline: 1px solid ; */
text-align: center;
}
.progress-bar li::before{
content: counter(step);
counter-increment: step;
width: 30px;
height: 30px;
border:1px solid #ddd;
display: block;
text-align: center;
margin: 0 auto 10px;
border-radius: 50%;
line-height: 30px;
background-color: #fff;
}
.progress-bar li::after{
content: '';
position: absolute;
width: 100%;
height: 1px;
background: #ddd;
top:15px;
left:-50%;
z-index: -1;
}
.progress-bar li:first-child::after{
content: none;
}
.progress-bar li.active{
color: green
}
.progress-bar li.active::before{
border-color: green
}
.progress-bar li.active + li:after{
background: green;
}