Skip to content
Let's talk

Case study · 2025

Stacking Cards

Cards that pile up as you scroll, in pure CSS.

Year
2025
Role
Creative coding experiment
Stack
HTML, CSS
Live site
paraschaturvedi.github.io (opens in a new tab)
Stacking Cards experiment: a mountain photo inside a paper textured card

Highlights

  • No JavaScript: every card uses position: sticky with the same top offset
  • Each card sits 10 pixels lower than the last, so earlier edges stay visible
  • Falls back to a normal list wherever sticky positioning is not supported

1 min readUpdated

This one has no JavaScript at all. Five cards sit in a list, and each one uses position: sticky with a top value of 100 pixels. As you scroll, a card reaches that line and stops, and the next card slides up over it. The result is a stack that builds itself as you move down the page.

The detail that makes it read as a stack is the padding. Each card gets 10 pixels more top padding than the one before it, so every new card settles a little lower than the last. That leaves a thin strip of the earlier cards showing above, like a pile of prints on a desk. The cards have a paper texture, a dark border and rounded corners, with the photo inside a padded figure.

The pattern suits case studies and testimonials, because it needs no scroll library and simply becomes a normal list where sticky positioning is not supported.