pseudo-element

::backdrop — CSS reference

Styles the backdrop box associated with a top-layer element. A modal dialog creates a backdrop when opened with showModal(); a nonmodal dialog opened with show() does not get that top-layer backdrop. Backdrop styling does not itself make a dialog modal.

Formal Syntax & Structure

css syntaxcss
dialog::backdrop { background: rgb(0 0 0 / 40%); }

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS reference lab</title><style>dialog::backdrop {background-color:rgba(0,0,0,.4)}</style><body><dialog id="a"><p>Review changes</p><form method="dialog"><button>Close</button></form></dialog><script>a.showModal();</script></body></html>
CSS Reference