Fluid Menu to Overlay Content CSS3 Animations

Editor's note (2026): The original 2014 version of this post reproduced the opening of a Designmodo tutorial. We've replaced it with our own summary and credit the original below. Vendor prefixes mentioned in the original (-webkit-, -moz-) are no longer needed for CSS animations.

The idea

A fluid menu made of four colored squares fills the screen. Clicking a square expands it into a full overlay with related content; closing the overlay reverses the animation and brings back the menu. All timing and delays are handled with CSS keyframes rather than JavaScript timers. The concept comes from a Designmodo tutorial on CSS3 animations.

CSS keyframe basics

Keyframes control an element's styles over time. You define the steps as percentages, where 0% is the start and 100% is the end. (from and to mean the same as 0% and 100%.)

@keyframes expand {
  0%   { transform: scale(1);   opacity: 1; }
  100% { transform: scale(4);   opacity: 0; }
}

.tile.is-open {
  animation: expand 0.6s ease-in-out forwards;
}

To animate several elements in sequence, give each one an animation-delay:

.tile:nth-child(2) { animation-delay: 0.1s; }
.tile:nth-child(3) { animation-delay: 0.2s; }
.tile:nth-child(4) { animation-delay: 0.3s; }

A small amount of JavaScript simply adds or removes a class (like is-open) when a tile or the close button is clicked; CSS does the rest.

Tips

  • Animate transform and opacity for smooth, efficient animations.
  • Respect users who prefer less motion with @media (prefers-reduced-motion: reduce).
  • Make sure the overlay can be closed with the keyboard (for example, the Escape key) and that focus moves into and out of it correctly.

Want engaging, polished animations on your website? I.T. For Less can help — contact us.

Design