Timeline List Template
A vertical timeline list for displaying events or milestones in chronological order.
This template creates a visually engaging way to present company history, project roadmaps, or step-by-step processes.

About this Template
This component uses a semantic ordered list (ol
) as its foundation. The timeline effect is created entirely with CSS, using the ::before
and ::after
pseudo-elements on the list and its items. A central vertical line is drawn behind the list items, and each item has a "dot" that connects it visually to the central line. This is a robust, CSS-only approach that keeps the HTML structure clean and meaningful.
Features
- Pure CSS Timeline: The visual timeline structure is created with pseudo-elements, requiring no extra HTML elements for styling.
- Semantic Markup: Uses an
ol
for a list of items that occur in a specific order. - Self-Contained Code: All styles are scoped within the
.timeline-template
class to prevent conflicts with your website's CSS. - Easy Customization: Key properties like colors, line thickness, and spacing are defined in CSS variables for simple themeing.
Code Breakdown
The timeline is built on a single ol
element with the class .timeline
. First, we use the ::before
pseudo-element on the list itself to draw the main vertical line down the center of the list's padding area.
Then, we use the ::before
pseudo-element on each list item (li
) to create the "dot" on the timeline. This dot is absolutely positioned to sit precisely on top of the central vertical line. The text content of each list item is pushed away from this central line using padding.
Code
Here's the full code for the template: