modal-dialog-backdrop-opacity.html (532B)
1 <!DOCTYPE html> 2 <link rel="author" title="Tim Nguyen" href="https://github.com/nt1m"> 3 <link rel="match" href="modal-dialog-backdrop-opacity-ref.html"> 4 <link rel="help" href="https://fullscreen.spec.whatwg.org/#user-agent-level-style-sheet-defaults"> 5 <style> 6 dialog::backdrop { 7 background-color: rgb(0, 128, 0); 8 opacity: 0.5; 9 } 10 dialog:focus { 11 outline: none; 12 } 13 </style> 14 <body> 15 <dialog>Test passes if you see a green backdrop at half opacity.</dialog> 16 <script> 17 document.querySelector('dialog').showModal(); 18 </script> 19 </body>