no-layout-containment-fixedpos-dynamic.html (744B)
1 <!DOCTYPE html> 2 <title>Position fixed elements should propagate from a container-type subtree.</title> 3 <link rel="help" href="https://github.com/w3c/csswg-drafts/issues/10544#issuecomment-2248438355"> 4 <link rel="match" href="/css/reference/ref-filled-green-100px-square-only.html"> 5 <style> 6 @container (width = 100px) { 7 #test { 8 position: fixed; 9 inset: 0; 10 background: green; 11 } 12 } 13 </style> 14 <p>Test passes if there is a filled green square.</p> 15 <div id="target" style="contain: layout; width: 200px; height: 100px; background: red;"> 16 <div style="container-type: inline-size; height: 0;"> 17 <div id="test"></div> 18 </div> 19 </div> 20 <script> 21 document.body.offsetTop; 22 document.getElementById('target').style.width = '100px'; 23 </script>