← Back toCSS Layout


Written byPhuoc Nguyen
12 Dec, 2019


<div class="timeline">
<!-- Left vertical line -->
<div class="timeline__line"></div>

<!-- The timeline items timeline -->
<div class="timeline__items">
<!-- Each timeline item -->
<div class="timeline__item">
<!-- The circle and title -->
<div class="timeline__top">
<!-- The circle -->
<div class="timeline__circle"></div>

<!-- The title -->
<div class="timeline__title">...</div>

<!-- The description -->
<div class="timeline__desc">...</div>

<!-- Repeat other items -->


.timeline {
/* Used to position the left vertical line */
position: relative;

.timeline__line {
/* Border */
border-right: 2px solid #d1d5db;

/* Positioned at the left */
left: 0.75rem;
position: absolute;
top: 0px;

/* Take full height */
height: 100%;

.timeline__items {
/* Reset styles */
list-style-type: none;
margin: 0px;
padding: 0px;

.timeline__item {
margin-bottom: 8px;

.timeline__top {
/* Center the content horizontally */
align-items: center;
display: flex;

.timeline__circle {
/* Rounded border */
background-color: #d1d5db;
border-radius: 9999px;

/* Size */
height: 1.5rem;
width: 1.5rem;

.timeline__title {
/* Take available width */
flex: 1;
margin-left: 0.5rem;

.timeline__desc {
/* Make it align with the title */
margin-left: 2rem;

Questions? 🙋

Do you have any questions? Not just about this specific post, but about any topic in front-end development that you'd like to learn more about? If so, feel free to send me a message on Twitter or send me an email. You can find them at the bottom of this page.
I have a long list of upcoming posts, but your questions or ideas for the next one will be my top priority. Let's learn together! Sharing knowledge is the best way to grow 🥷.

Recent posts ⚡

Newsletter 🔔

If you're into front-end technologies and you want to see more of the content I'm creating, then you might want to consider subscribing to my newsletter.
By subscribing, you'll be the first to know about new articles, products, and exclusive promotions.
Don't worry, I won't spam you. And if you ever change your mind, you can unsubscribe at any time.
Phước Nguyễn