Putting CSS Clip to Work: Expanding Overlay Effect | Codrops
A tutorial about how to create a simple expanding overlay effect using the CSS clip property and CSS transitions.
VIEW DEMO DOWNLOAD SOURCE
Our previous article, Understanding the CSS Clip Property by Hugo Giraudel offers a great overview of the CSS clip property and the rect() function. Today we want to explore the practical side of it a little bit more. We are going to create a neat and simple effect for revealing some extra content and expanding a fullscreen overlay.
We want to show how to leverage the CSS clip property to make a smooth transition when clicking on a box element. The idea is to show some kind of overlay as if it’s actually underneath the respective element. Clicking an element will create a cut-out effect, revealing another layer that will expand.