contain-content-003.html (1196B)
1 <!DOCTYPE html> 2 3 <meta charset="UTF-8"> 4 5 <title>CSS Containment Test: element with 'contain: content' and absolutely positioned descendants</title> 6 7 <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> 8 <link rel="help" href="https://drafts.csswg.org/css-contain/#contain-property"> 9 <link rel="match" href="../reference/ref-filled-green-100px-square.xht"> 10 11 <meta name="assert" content="This test checks that an element with 'contain: content' acts as containing block for its absolutely positioned descendants."> 12 13 <style> 14 div 15 { 16 width: 100px; 17 } 18 19 div#contain-content 20 { 21 background-color: red; 22 contain: content; 23 height: 100px; 24 } 25 26 div.abspos 27 { 28 background-color: green; 29 height: 50px; 30 position: absolute; 31 right: 0; 32 } 33 34 div#first-abspos 35 { 36 top: 0px; 37 } 38 39 div#second-abspos 40 { 41 bottom: 0px; 42 } 43 </style> 44 45 <body> 46 47 <p>Test passes if there is a filled green square and <strong>no red</strong>. 48 49 <div id="contain-content"> 50 <div id="first-abspos" class="abspos"></div> 51 <div id="second-abspos" class="abspos"></div> 52 </div>