<div class="container">
<div id="timeline">
<ol>
<li class="active">
<span class="point"></span>
<h6 class="diplome">My Birthday</h6>
<p class="timestamp">2018/06/01</p>
</li>
<li class="active">
<span class="point"></span>
<h6 class="diplome">Father's Day</h6>
<p class="timestamp">2018/08/08</p>
</li>
<li>
<span class="point"></span>
<h6 class="diplome">Helloween</h6>
<p class="timestamp"></p>
</li>
<li>
<span class="point"></span>
<h6 class="diplome">Christmas</h6>
<p class="timestamp"></p>
</li>
</ol>
</div>
</div>
@import url('https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css');
$line-color: #FA8072;
$point-color: #FF4500;
$point-size: 16px;
$half-point-size: $point-size/2;
$active-font-color: #FA8072;
$inactive-font-color: rgba(0, 0, 0, 0.5);
$event-num: 4;
#timeline {
ol {
position: relative;
display: block;
margin-top: 50px;
margin-bottom: 100px;
height: 1px;
padding-inline-start: 0;
}
li {
position: relative;
display: inline-block;
float: left;
width: calc(100% / #{$event-num});
height: 1px;
background: $line-color;
color: $inactive-font-color;
.diplome {
text-align: center;
margin-top: 20px;
}
.point {
content: "";
display: block;
width: $point-size;
height: $point-size;
border-radius: 50%;
border: 1px solid $point-color;
background: #fff;
position: absolute;
top: -#{$half-point-size};
left: calc(50% - #{$half-point-size});
}
.timestamp {
font-size: 14px;
text-align: center;
}
&.active>.point {
border: $half-point-size solid $point-color;
}
&.active>.diplome,
&.active>.timestamp {
color: $active-font-color;
}
}
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.