DEV Community

Cover image for Curved Timeline in CSS

Curved Timeline in CSS

Jatin Sharma on November 28, 2021

In this article, we are gonna build a curved timeline for your website which you can use later on in your portfolio to display your work history or...
Collapse
 
elalemanyo profile image
Alemaño

Nice idea @j471!
Using your inspiration I create my own version. I use the pseudo element to create the border, but just for 50% of it. After using negative margin looks like a curved line.

And here the code: codepen.io/elalemanyo/full/QWqydLp

Thanks again for the inspiration 👏

Collapse
 
j471n profile image
Jatin Sharma

keep it up :) 🔥

Collapse
 
animald profile image
animald • Edited

Nice work!

Though it looks a pixel out on my device, where the borders overlap.

dev-to-uploads.s3.amazonaws.com/up...

Collapse
 
mario_im profile image
Mario

fix:

.card:nth-child(odd)::before {
left: 0px;
top: -5px;
bottom: -4.5px;
border-width: 5px 0 5px 5px;
border-radius: 50px 0 0 50px;
}

Collapse
 
animald profile image
animald

Ah, it is only now that I realise that the original example was using 4.5px.

Jatin, what was the reason for this? What is your default browser?

Thread Thread
 
j471n profile image
Jatin Sharma

Well, I am using Edge browser, It was only a pixel out in the mobile devices so I fixed it with the @media queries. you can see the updated version now. Thanks to all of you guys for pointing it out :)

Thread Thread
 
mario_im profile image
Mario

Chrome :)

Collapse
 
andrewbaisden profile image
Andrew Baisden

Cool concept this is an interesting way of getting it to work.

Collapse
 
tlcheung profile image
TL Cheung

Do you know how ot make a moving timeline like this one?crustac.fr/en/home/

Collapse
 
op profile image
op

It's an SVG path that's animated on scroll.

css-tricks.com/scroll-drawing/

Collapse
 
nikita_33 profile image
Nikita Kubavat

Awesome 🤩