overlay

A property used for elements in the 'top layer' (like <dialog> or popovers). It specifies whether an element should be rendered in the top layer even when it's not the active modal.

It is documented as part of the CSS Positioned Layout specification. This is an experimental technology. The syntax and behavior are still subject to change.

/* Usage Example */
.active-popover {
  /* Ensures the popover stays in the top layer during transitions */
  overlay: auto;
  transition: overlay 0.5s allow-discrete;
}

/* Syntax */
overlay: none;
overlay: auto;

/* Global values */
overlay: inherit;
overlay: initial;
overlay: revert;
overlay: revert-layer;
overlay: unset;
Limited availability Since 2020 73% global usage

This feature is not Baseline because it does not work in some of the most widely-used browsers.

117+
117+
Kinsta

Your first month is free

Managed WordPress hosting for faster sites.

Learn more

New CSS drops.

Join 600+ readers who've survived clearfix hacks.

ESC