<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>HTML</title>
<style>
html, body {
margin: 0;
padding: 0;
font-family: Helvetica, sans-serif;
}
body {
background: #25303B;
}
.timeline {
position: relative;
width: 80%;
margin: 20px auto;
}
.timeline::after {
content: '';
position: absolute;
width: 6px;
background-color: white;
top: 0;
bottom: 0;
left: 50%;
margin-left: -3px;
}
.container {
padding: 10px 40px;
position: relative;
background-color: inherit;
width: 50%;
}
/* The circles on the timeline */
.container::after {
content: '';
position: absolute;
width: 25px;
height: 25px;
right: -17px;
background-color: white;
border: 3px solid blue;
top: 16px;
border-radius: 50%;
z-index: 1;
}
.left {
left: 0;
}
.right {
left: 50%;
}
.left::before {
content: " ";
height: 0;
position: absolute;
top: 22px;
width: 0;
z-index: 1;
right: 30px;
border: medium solid white;
border-width: 10px 0 10px 10px;
border-color: transparent transparent transparent white;
}
/* Add arrows to the right container (pointing left) */
.right::before {
content: " ";
height: 0;
position: absolute;
top: 20px;
width: 0;
z-index: 1;
left: 30px;
border: 2px solid blue;
border-width: 10px 10px 10px 0;
border-color: transparent white transparent transparent;
}
/* Fix the circle for containers on the right side */
.right::after {
left: -16px;
}
/* The actual content */
.content {
padding: 20px 30px;
background-color: white;
position: relative;
border-radius: 6px;
}
h2 {
color: green;
}
@media screen and (max-width: 600px) {
/* Place the timelime to the left */
.timeline::after {
left: 30px;
}
.container {
width: 100%;
padding-left: 75px;
padding-right: 20px;
}
/* Make sure that all arrows are pointing leftwards */
.container::before {
left: 60px;
border: medium solid white;
border-width: 10px 10px 10px 0;
border-color: transparent white transparent transparent;
}
/* Make sure all circles are at the same spot */
.left::after, .right::after {
left: 15px;
}
/* Make all right containers behave like the left ones */
.right {
left: 0%;
}
}
</style>
</head>
<body>
<div class="timeline">
<div class="container left">
<div class="content">
<h2>2019</h2>
<p>The Foundation day </p>
</div>
</div>
<div class="container right">
<div class="content">
<h2>2020</h2>
<p>Annual Meet </p>
</div>
</div>
</div>
</body>
</html>