contain-layout-formatting-context-margin-001.html (957B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>CSS Test: 'contain: layout' with a vertical margin child. Margin collapse should not occur, and neither should overflow clipping.</title> 6 <link rel="author" title="Kyle Zentner" href="mailto:zentner.kyle@gmail.com"> 7 <link rel="author" title="Morgan Rae Reschenberg" href="mailto:mreschenberg@berkeley.edu"> 8 <link rel="help" href="https://drafts.csswg.org/css-contain/#containment-layout"> 9 <link rel="match" href="contain-layout-formatting-context-margin-001-ref.html"> 10 <style> 11 #a { 12 contain:layout; 13 background: blue; 14 margin: 10px; 15 width: 50px; 16 height: 50px; 17 } 18 #b { 19 width: 50px; 20 height: 40px; 21 background: green; 22 margin-top: 10px; 23 } 24 #c { 25 background: lightblue; 26 width: 50px; 27 height: 10px; 28 } 29 </style> 30 </head> 31 <body> 32 <div id="a"> 33 <div id="b"></div> 34 <div id="c"></div> 35 </div> 36 </body> 37 </html>