::backdrop
Quick Summary for ::backdrop
The ::backdrop CSS pseudo-element is a box the size of the viewport which is rendered immediately beneath any element being presented in fullscreen mode. This includes both elements which have been placed in fullscreen mode using the Fullscreen API and <dialog> elements.
Code Usage for ::backdrop
/* Backdrop is only displayed when dialog is opened with dialog.showModal() */ dialog::backdrop {   background: rgba(255,0,0,.25); } 
More Details for ::backdrop

::backdrop

The ::backdrop CSS pseudo-element is a box the size of the viewport which is rendered immediately beneath any element being presented in fullscreen mode. This includes both elements which have been placed in fullscreen mode using the Fullscreen API and <dialog> elements.

When multiple elements have been placed into fullscreen mode, the backdrop is drawn immediately beneath the frontmost such element, and on top of the older fullscreen elements.

/* Backdrop is only displayed when dialog is opened with dialog.showModal() */ dialog::backdrop {   background: rgba(255,0,0,.25); } 

All fullscreen elements are placed in a last-in/first out (LIFO) stack in the top layer, which is a special layer in the viewport which is always rendered last (and therefore on top) before drawing the viewport's contents to the screen. The ::backdrop pseudo-element makes it possible to obscure, style, or completely hide everything located below the element when it's the topmost one in the top layer.

::backdrop neither inherits from nor is inherited by any other elements. No restrictions are made on what properties apply to this pseudo-element.

Syntax

::backdrop

Examples

Styling the backdrop for fullscreen video

In this example, the backdrop style used when a video is shifted to fullscreen mode is configured to be a grey-blue color rather than the black it defaults to in most browsers.

video::backdrop {   background-color: #448; } 

The resulting screen looks like this:

See this example in action, after changing the color of the background cause the video to go fullscreen to see the change to the backdrop color.

Specifications

Specification
Fullscreen API Standard # ::backdrop-pseudo-element

See also

:fullscreen pseudo-class <dialog> HTML element Fullscreen API

Last modified: Feb 15, 2022, by MDN contributors

Select your preferred language English (US)DeutschEspañolFrançais日本語Português (do Brasil)Русский中文 (简体) Change language

No Items Found.

Add Comment
Type in a Nick Name here
 
Related Search Terms
Other Categories in CSS
css
Search CSS
Search CSS by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

Subscribe to weekly updates about things i have added to the site or thought interesting during the last week.

You could also follow me on twitter or not... does anyone even use twitter anymore?

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote
therock Somewhere along this crazy road I learned (often times the hard way) the most important things I can do is be authentic, trust my gut, be the hardest worker in the room, celebrate the mistakes, be a grateful man and always remember that it's nice to be important, but it's more important to be nice.
The Rock
Random CSS Property

:target

The :target CSS pseudo-class represents a unique element (the target element) with an id matching the URL's fragment.
:target css reference