flex-minimum-height-flex-items-018.html (1006B)
1 <!DOCTYPE html> 2 <title>CSS Flexbox: min-height: auto with flex items containing percentage-sized children</title> 3 <link rel="author" title="Google LLC" href="https://www.google.com/" /> 4 <link rel="help" href="https://drafts.csswg.org/css-flexbox/#min-size-auto" /> 5 <link rel="issue" href="https://bugs.chromium.org/p/chromium/issues/detail?id=998080" /> 6 <link rel="match" href="../reference/ref-filled-green-100px-square.xht" /> 7 8 <style> 9 .flexbox { 10 display: flex; 11 width: 100px; 12 height: 0; 13 flex-direction: column; 14 } 15 .item { 16 /* Because the flexbox has height:0, this would flex-shrink to 0. So we rely 17 * on min-height: auto to get a nonzero height. */ 18 height: 100px; 19 background: green; 20 } 21 .percentage { 22 height: 100%; 23 } 24 .fixed { 25 height: 100px; 26 } 27 28 </style> 29 30 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 31 32 <div class="flexbox"> 33 <div class="item"> 34 <div class="percentage"> 35 <div class="fixed"></div> 36 </div> 37 </div> 38 </div>