Web features explorer

overlay

Limited availability

The overlay CSS property, used as an allow-discrete CSS transition, prevents a top layer element, such as a popover or a <dialog>, from being removed from the top layer before it has finished animating. You can't set the value of the overlay property; only use it as transition property.

Browser support

  • Chrome 117 Released on 2023-09-12
  • Chrome Android 117 Released on 2023-09-12
  • Edge 117 Released on 2023-09-15
  • Firefox Not supported Position Bugs: 1841456
  • Firefox for Android Not supported Position Bugs: 1841456
  • Safari Not supported Position
  • Safari on iOS Not supported Position

Need this feature?
Leave a 👍 on the feedback issue
Don't forget to also leave a comment explaining your specific use case.

MDN documentation

Usage (according to Chrome Platform Status)

~0.149% of page loads. More data at chromestatus.com.

Developer use cases

  • While the overlay property is almost useless because developers can't change the open state for dialogs and popovers from their code editors. The property itself combined with animating display none and content-visibility hidden for popovers, dialogs and other popup elements with the @starting-style rule will be useful to developers can use to have a smooth transition within the top layer from the ::backdrop pseudo element. Thus animating display animating display none and content-visibility hidden for popovers, dialogs and other popup elements will feel incomplete without the overlay property that developers use in transitions. All of the browsers have support for the transition-behavior property for discrete animations and the @starting-style rule to apply styles before rendering the page. Chromium Browsers with Safari have full support animating display none and content-visibility hidden for popovers, dialogs and other popup elements, but Firefox does not (though their developers have been working on it and are prototyping it which it can be enable by this flag layout.css.display-animations.enabled Chromium Browsers are the only browsers that support the full set of animating display none and content-visibility hidden with the overlay property for dialogs. As of the moment developers are happy that we can animate display and discrete animations on the web. It would be nice if we can animate the backdrop and top layer over the content of the web. While the overlay property is almost useless because developers can't change the open state for dialogs and popovers from their code editors. The property itself combined with animating display none and content-visibility hidden for popovers, dialogs and other popup elements with the @starting-style rule will be useful to developers can use to have a smooth transition within the top layer from the ::backdrop pseudo element. Thus animating display animating display none and content-visibility hidden for popovers, dialogs and other popup elements will feel incomplete without the overlay property that developers use in transitions. All of the browsers have support for the transition-behavior property for discrete animations and the @starting-style rule to apply styles before rendering the page. Chromium Browsers with Safari have full support animating display none and content-visibility hidden for popovers, dialogs and other popup elements, but Firefox does not (though their developers have been working on it and are prototyping it which it can be enable by this flag layout.css.display-animations.enabled Chromium Browsers are the only browsers that support the full set of animating display none and content-visibility hidden with the overlay property for dialogs. As of the moment developers are happy that we can animate display and discrete animations on the web. It would be nice if we can animate the backdrop and top layer over the content of the web. [see original comment]