block-container-non-adjoining-item-ref.html (757B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>margin-trim: block-container-non-adjoining-item</title> 5 <link rel="author" title="Sammy Gill" href="mailto:sammy.gill@apple.com"> 6 <link rel="help" href="https://drafts.csswg.org/css-box-4/#margin-trim-block"> 7 <meta name="assert" content="non-adjoining first child should still have its margins trimmed and the container should keep its set margin"> 8 <style> 9 .container { 10 background-color: green; 11 width: min-content; 12 margin-bottom: 100px; 13 padding-bottom: 50px; 14 background-clip: padding-box; 15 } 16 .child { 17 width: 100px; 18 height: 50px; 19 } 20 </style> 21 </head> 22 <body> 23 <div class="container"> 24 <div class="child"></div> 25 </div> 26 <div>This text should be 100px below the green square.</div> 27 </body> 28 </html>