Ronalds Vilciņš

You can transition z-index

transition is a CSS property that allows you to specify the transition effect that should occur when an element’s state changes. For example, you can use the transition property to specify that an element should smoothly transition to a new size, color, or position when it is hovered over, or when it is clicked.

You can also transition z-index:

@keyframes move {
  from { z-index: 0; transform: scale(1); }
  to { z-index: 4; transform: scale(2.5); }

This site is ad-free and doesn’t use trackers. If you’d like to support my writing, I’d love if you could buy me a coffee.