flexbox-definite-sizes-003.html (1084B)
1 <!doctype html> 2 <meta charset="utf-8"> 3 <title>CSS Test: nested flex containers with definite max-height</title> 4 <link rel="match" href="flexbox-definite-sizes-001-ref.html"> 5 <link rel="author" href="mailto:dholbert@mozilla.com" title="Daniel Holbert"> 6 <link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez"> 7 <link rel="help" href="https://drafts.csswg.org/css-flexbox/#definite-sizes"> 8 <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1449326"> 9 <style> 10 body { overflow: hidden } 11 12 .outerFlex { 13 display: flex; 14 width: 100px; 15 /* Implicit "align-items:stretch" */ 16 } 17 18 .innerFlex { 19 display: flex; 20 width: 100px; 21 background: red; 22 23 /* This reveals if we miscalculate the height of our flex item: */ 24 align-items: flex-end; 25 } 26 27 .block { 28 width: 100px; 29 max-height: 100%; 30 background-color: green; 31 } 32 </style> 33 <p>Test passes if you see a green 100px x 100px square, and no red</p> 34 <div class="outerFlex" style="max-height: 100px"> 35 <div class="innerFlex"> 36 <div class="block"><div style="height:9999px"></div></div> 37 </div> 38 </div>