grid-as-flex-item-should-not-shrink-to-fit-006.html (1732B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Grid Layout Test: Evaluate the behavior of a grid container as Flexbox item</title> 4 <link rel="author" title="Javier Fernandez Garcia-Boente" href="mailto:jfernandez@igalia.com"> 5 <link rel="help" href="https://drafts.csswg.org/css-grid/#layout-algorithm"> 6 <link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#flex-lines"> 7 <link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#propdef-flex-wrap"> 8 <link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#propdef-justify-content"> 9 <link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#propdef-align-self"> 10 <link rel="help" href="https://drafts.csswg.org/css-align-3/#align-flex"> 11 <link rel="help" href="https://drafts.csswg.org/css-align-3/#align-grid"> 12 <link rel="match" href="../../reference/ref-filled-green-100px-square.xht"> 13 <meta name="assert" content="The align-content: 'stretch' prevents the multi-line column flexbox to shrink-to-fit (default behavior), hence the grid container will be stretched, honoring its align-self: 'normal (behaves as 'stretch'), as well as grid item, honoring its justify-self: 'normal' (behaves as 'stretch') "> 14 <style> 15 body { overflow: hidden; } 16 .flexbox { 17 display: flex; 18 flex-flow: column wrap; 19 justify-content: stretch; 20 width: 100px; 21 height: 100px; 22 background: red; 23 } 24 .grid { 25 display: grid; 26 align-items: start; 27 } 28 .gridItem { 29 background: green; 30 height: 100px; 31 } 32 </style> 33 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 34 <div class="flexbox"> 35 <div class="grid"> 36 <div class="gridItem"></div> 37 </div> 38 </div>