CSS Vertical Timeline Animation
A vertical timeline whose rail draws from the top and whose cards fade up in order as the list scrolls into view.

A vertical timeline is a list of events on a single rail. Portfolios, changelogs, order tracking, and “how it works” sections all reach for it, and the static version is a line with dots. The animated version draws the rail from the top and brings each card in a beat later, so the order of the story and the order of the motion are the same thing.
The rail is a ::before line on the list, scaled on the Y axis from scaleY(0) to scaleY(1) with transform-origin: top. Each item starts faded and shifted down. IntersectionObserver adds is-in when the list is on screen, and a short timeout staggers the items. No animation library.
If the story is a stack of full-bleed panels, use the stacked cards scroll instead. If a single sentence should reveal as you read, use the scroll-triggered text reveal. A timeline is for dated events.
HTML
Use an ordered list. The sequence is the content. The line is decoration.
<ol class="timeline" id="timeline">
<li class="item">
<article>
<time datetime="2024">2024</time>
<h2>Name the motion</h2>
<p>Pick one job for the animation: show order.</p>
</article>
</li>
</ol>
The dot is an <i> or a span, empty, and hidden from assistive tech if you add one. The time element carries the date. Write the year in the element even if you also style a dot, because the dot will not be read.
CSS
.timeline { position: relative; }
.timeline::before {
content: "";
position: absolute;
left: 18px;
top: 0;
bottom: 0;
width: 2px;
background: #eadfd4;
transform: scaleY(0);
transform-origin: top;
transition: transform 1.1s ease;
}
.timeline.is-in::before { transform: scaleY(1); }
.item {
padding-left: 3.2rem;
opacity: 0;
transform: translateY(16px);
transition: opacity .6s ease, transform .6s ease;
}
.item.is-in { opacity: 1; transform: none; }
The dot sits on the rail with a ring the color of the page (box-shadow: 0 0 0 6px #faf7f2) so the line looks like it passes behind the marker. When the item is in, fill the dot with the same terracotta as the date.
Stagger without a library
const io = new IntersectionObserver((entries) => {
if (!entries.some((entry) => entry.isIntersecting)) return;
list.classList.add("is-in");
items.forEach((item, index) => {
setTimeout(() => item.classList.add("is-in"), 180 + index * 140);
});
io.disconnect();
}, { threshold: 0.25 });
io.observe(list);
140ms between cards is enough to read as a sequence and short enough that a four-item list finishes in under a second. Ten items at 140ms is a long wait. Cap the stagger or reveal the rest together after the fourth.
Mobile
The demo is a single column: rail on the left, cards on the right. The alternating left-right timeline that shows up in older galleries forces a narrow card on a phone and a horizontal jump on a desktop. One side is easier to scan and the rail stays a clear spine. If you do alternate, do it from a min-width where each card still has a readable measure.
Accessibility
Reduced motion paints the line and the cards in their final state with no delay. The list is in the tab order as normal text. Nothing is hidden after the entrance, so there is no “content only exists if you watched the animation” trap.
Dates use <time datetime>. Headings stay in order down the list. The entrance does not move focus.
Questions about vertical timelines
How do I animate a vertical timeline in CSS?
Draw the rail with a pseudo-element and transition scaleY from 0 to 1, origin at the top. Fade and raise each item with a transform. Add the visible class when an IntersectionObserver reports the list on screen, and stagger the items with a short delay.
Should timeline items alternate left and right?
On a wide editorial page, alternating can look like a poster. For a product changelog or a help article, keep every card on one side of the rail. The eye follows a straight line, and the layout does not collapse into a puzzle on a phone.
Can I build the reveal with scroll-driven animations?
Yes. animation-timeline: view() can drive the rail and the item opacity without JavaScript in browsers that support it. The observer version in this snippet runs everywhere you already ship JS, and it fails open: if the observer never fires, you can add is-in by default in a noscript style. The demo adds the class from script. If script fails, add a CSS rule .timeline::before { transform: none } inside a @supports test or default the items to visible and let the script hide them only when it is about to animate. The reduced-motion rule in the demo also forces the final state.